本文整理汇总了C#中IMenuItem.SetActionView方法的典型用法代码示例。如果您正苦于以下问题:C# IMenuItem.SetActionView方法的具体用法?C# IMenuItem.SetActionView怎么用?C# IMenuItem.SetActionView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMenuItem
的用法示例。
在下文中一共展示了IMenuItem.SetActionView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefreshItems
void RefreshItems(IMenuItem item)
{
ImageView imageView;
Animation rotation = AnimationUtils.LoadAnimation (this, Resource.Animation.Rotate);
rotation.RepeatCount = Animation.Infinite;
imageView = (ImageView)LayoutInflater.Inflate (Resource.Layout.RefreshImageView, null);
imageView.StartAnimation (rotation);
item.SetActionView (imageView);
appPagerAdapter.RefreshList (appViewPager.CurrentItem);
Handler handler = new Handler ();
handler.PostDelayed (() => {
imageView.ClearAnimation ();
item.SetActionView (null);
}, 1000);
}
示例2: OnOptionsItemSelected
public override bool OnOptionsItemSelected(IMenuItem item)
{
if (item.ItemId == 1) {
Intent intent = new Intent (this, typeof(AddMovieToCatalogActivity));
intent.PutExtra ("Name", catalog.Name);
intent.PutExtra ("Id", catalog.Id);
StartActivityForResult (intent, 16);
} else if (item.ItemId == 2) {
Animation rotation = AnimationUtils.LoadAnimation (this, Resource.Animation.Rotate);
rotation.RepeatCount = Animation.Infinite;
ImageView imageView = (ImageView)LayoutInflater.Inflate (Resource.Layout.RefreshImageView, null);
imageView.StartAnimation (rotation);
item.SetActionView (imageView);
ActualizarLista ();
Handler handler = new Handler ();
handler.PostDelayed (() => {
imageView.ClearAnimation ();
item.SetActionView (null);
}, 1000);
} else if (item.ItemId == 3) {
Intent intent = new Intent (this, typeof(AuthActivity));
StartActivityForResult (intent, 13);
} else if (item.ItemId == Android.Resource.Id.Home) {
OnBackPressed ();
}
return base.OnOptionsItemSelected (item);
}