当前位置: 首页>>代码示例>>C#>>正文


C# View.RequestFocus方法代码示例

本文整理汇总了C#中Android.Views.View.RequestFocus方法的典型用法代码示例。如果您正苦于以下问题:C# View.RequestFocus方法的具体用法?C# View.RequestFocus怎么用?C# View.RequestFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android.Views.View的用法示例。


在下文中一共展示了View.RequestFocus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowKeyboard

 public static void ShowKeyboard(Context context, View pView)
 {
     pView.RequestFocus();
     InputMethodManager inputMethodManager = (InputMethodManager)context.GetSystemService (Context.InputMethodService);
     inputMethodManager.ShowSoftInput(pView, ShowFlags.Forced);
     inputMethodManager.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.ImplicitOnly);
 }
开发者ID:FrederickEskens,项目名称:Totem,代码行数:7,代码来源:KeyboardHelper.cs

示例2: OnChildLaidOut

		public void OnChildLaidOut(ViewGroup parent, View view, int position, long id)
		{
			if (view != null && position == 0)
			{
				view.RequestFocus();
			}
		}
开发者ID:lothrop,项目名称:MvvmCross-AndroidSupport,代码行数:7,代码来源:MvxFocusFirstChildOnChildLaidOutListener.cs

示例3: showSoftKeyboard

		public void showSoftKeyboard(View view) {
			if (view.RequestFocus()) {
				
				InputMethodManager imm = (InputMethodManager)
					GetSystemService (Context.InputMethodService);
					//getSystemService(Context.INPUT_METHOD_SERVICE);
				//imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
				imm.ShowSoftInput (view, InputMethodManager.ShowImplicit);
			}
		}
开发者ID:scrafty614,项目名称:XamarinStudio_Example,代码行数:10,代码来源:login.cs

示例4: animateAlphaTranslate

        private void animateAlphaTranslate(View view, float alphaFrom, float alphaTo, float xFrom, float xTo,
            bool requestFocus)
        {
            AnimationSet animationSet = new AnimationSet(true);

            AlphaAnimation fade = new AlphaAnimation(alphaFrom, alphaTo);
            fade.Duration = 350;

            TranslateAnimation slide = new TranslateAnimation(Dimension.RelativeToSelf, xFrom,
                                                              Dimension.RelativeToSelf, xTo,
                                                              Dimension.RelativeToSelf, 0,
                                                              Dimension.RelativeToSelf, 0);

            slide.Duration = 350;

            animationSet.AddAnimation(fade);
            animationSet.AddAnimation(slide);
            view.StartAnimation(animationSet);

            if (requestFocus)
            {
                animationSet.AnimationEnd += (obj, args) => view.RequestFocus();
            }
        }
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:24,代码来源:CardEntryView.cs

示例5: OnClick

        public override void OnClick(View v)
        {
            v.Focusable = true;
            v.FocusableInTouchMode = true;
            v.RequestFocus ();
            if (v == EditButton || v == BackButton) {
                Warning.Visibility = ViewStates.Gone;

                SwitchVisibility (DropDownButton);
                SwitchVisibility (BackButton);

                SwitchVisibility (EditButton);
                SwitchVisibility (RemoveButton);

                SwitchVisibility (Product);
                SwitchVisibility (EditProduct);

                SwitchVisibility (Price);
                SwitchVisibility (EditPrice);

                if (v == BackButton) {
                    Product.Text = EditProduct.Text;
                    Price.Text = EditPrice.Text;
                }
                _onClick (new ListItemEventArgs (LayoutPosition, -3));

            } else if (v == Product || v == DropDownButton) {
                if (DropDown.Visibility == ViewStates.Gone) {
                    DropDown.Visibility = ViewStates.Visible;
                } else {
                    DropDown.Visibility = ViewStates.Gone;
                }
                _onClick (new ListItemEventArgs (LayoutPosition, -2));
            } else if (v == RemoveButton){
                _onClick (new ListItemEventArgs (LayoutPosition, -1));
            } else {
                int i = 0;
                foreach (TextView tv in Initials) {
                    if (v == tv) {
                        _onClick(new ListItemEventArgs(LayoutPosition, i));
                        break;
                    }
                    i++;
                }
            }
            v.Focusable = false;
        }
开发者ID:SansSkill,项目名称:Introproject,代码行数:47,代码来源:ListItemAdapter.cs


注:本文中的Android.Views.View.RequestFocus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。