本文整理汇总了C#中Xamarin.SetActionView方法的典型用法代码示例。如果您正苦于以下问题:C# Xamarin.SetActionView方法的具体用法?C# Xamarin.SetActionView怎么用?C# Xamarin.SetActionView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xamarin
的用法示例。
在下文中一共展示了Xamarin.SetActionView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnOptionsItemSelected
public override bool OnOptionsItemSelected(Xamarin.ActionbarSherlockBinding.Views.IMenuItem item)
{
switch (item.ItemId) {
case Resource.Id.homeAsUp:
// TODO handle clicking the app icon/logo
return false;
case Resource.Id.menu_refresh:
// switch to a progress animation
item.SetActionView(Resource.Layout.indeterminate_progress_action);
return true;
case Resource.Id.menu_both:
// rotation animation of green fragment
RotateLeftFrag();
return true;
case Resource.Id.menu_text:
// alpha animation of blue fragment
ObjectAnimator alpha = ObjectAnimator.OfFloat(rightFrag.View, "alpha", 1f, 0f);
alpha.RepeatMode = ValueAnimatorRepeatMode.Reverse;
alpha.RepeatCount = 1;
alpha.SetDuration(800);
alpha.Start();
return true;
case Resource.Id.menu_logo:
useLogo = !useLogo;
item.SetChecked(useLogo);
base.SupportActionBar.SetDisplayUseLogoEnabled(useLogo);
return true;
case Resource.Id.menu_up:
showHomeUp = !showHomeUp;
item.SetChecked(showHomeUp);
base.SupportActionBar.SetDisplayHomeAsUpEnabled(showHomeUp);
return true;
case Resource.Id.menu_nav_tabs:
item.SetChecked(true);
ShowTabsNav();
return true;
case Resource.Id.menu_nav_label:
item.SetChecked(true);
ShowStandardNav();
return true;
case Resource.Id.menu_nav_drop_down:
item.SetChecked(true);
ShowDropDownNav();
return true;
case Resource.Id.menu_bak_none:
item.SetChecked(true);
base.SupportActionBar.SetBackgroundDrawable(null);
return true;
case Resource.Id.menu_bak_gradient:
item.SetChecked(true);
base.SupportActionBar.SetBackgroundDrawable(Resources.GetDrawable(Resource.Drawable.ad_action_bar_gradient_bak));
return true;
default:
return base.OnOptionsItemSelected(item);
}
}
示例2: OnMenuItemClick
////on selecting show progress spinner for 1s
public bool OnMenuItemClick(Xamarin.ActionbarSherlockBinding.Views.IMenuItem item)
{
item.SetActionView(Resource.Layout.indeterminate_progress_action);
Thread.Sleep(10);
// Handler.PostDelayed(new Java.Lang.Runnable() {
// public void run() {
// refresh.setActionView(null);
// }
// }, 1000);
// return false;
return false;
}