本文整理汇总了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);
}
示例2: OnChildLaidOut
public void OnChildLaidOut(ViewGroup parent, View view, int position, long id)
{
if (view != null && position == 0)
{
view.RequestFocus();
}
}
示例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);
}
}
示例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();
}
}
示例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;
}