本文整理汇总了C#中ActionBar类的典型用法代码示例。如果您正苦于以下问题:C# ActionBar类的具体用法?C# ActionBar怎么用?C# ActionBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionBar类属于命名空间,在下文中一共展示了ActionBar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TabOnTabSelected
void TabOnTabSelected(object sender, ActionBar.TabEventArgs tabEventArgs)
{
var tab = (ActionBar.Tab)sender;
Fragment frag = _fragments[tab.Position];
tabEventArgs.FragmentTransaction.Replace(Resource.Id.frameLayout1, frag);
}
开发者ID:jj09,项目名称:ShoppingPad,代码行数:7,代码来源:MainActivity.cs
示例2: OnTabSelected
public void OnTabSelected (ActionBar.Tab tab, FragmentTransaction ft)
{
TitlesFragment titleFrag = (TitlesFragment) FragmentManager.FindFragmentById (Resource.Id.frag_title);
titleFrag.PopulateTitles (tab.Position);
titleFrag.SelectPosition (0);
}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:7,代码来源:MainActivity.cs
示例3: SetupTabs
void SetupTabs(ActionBar actionBar) {
for (int i = 0; i < actionBar.TabCount; i++) {
ActionBar.Tab tab = actionBar.GetTabAt(i);
if (TabIsEmpty(tab))
TabSetup(tab, GetTabIconId(i));
}
}
开发者ID:RMDesenvolvimento,项目名称:Xamarin,代码行数:7,代码来源:TabRenderer.cs
示例4: TabOnTabSelected
void TabOnTabSelected(object sender, ActionBar.TabEventArgs tabEventArgs)
{
ActionBar.Tab tab = (ActionBar.Tab)sender;
Log.Debug(Tag, "The tab {0} has been selected.", tab.Text);
Fragment frag = _fragments[tab.Position];
tabEventArgs.FragmentTransaction.Replace(Resource.Id.frameLayout1, frag);
}
开发者ID:RamBachkheti,项目名称:Xamarin-Samples,代码行数:7,代码来源:MainActivity.cs
示例5: OnTabUnselected
public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft)
{
this.RunOnUiThread(() =>
{
Toast.MakeText(this, "OnTabUnselected " + tab.Text, ToastLength.Long).Show();
});
}
开发者ID:cirk0r,项目名称:PW,代码行数:7,代码来源:MainActivity.cs
示例6: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Response);
userDao = new UserDao();
postService = new PostService();
audioService = new SendAudioService();
deliverPostService = new SendPostService();
actionBar = SupportActionBar;
actionBar.SetHomeButtonEnabled(false);
actionBar.SetDisplayHomeAsUpEnabled(false);
actionBar.SetDisplayUseLogoEnabled(false);
actionBar.SetDisplayShowHomeEnabled(false);
actionBar.Title = "Responder";
chronometer = FindViewById<TextView>(Resource.Id.recording_lenght);
previewRecord = FindViewById<ImageView>(Resource.Id.record_image);
message = FindViewById<EditText>(Resource.Id.criar_topico_conteudo);
submit = FindViewById<Button>(Resource.Id.criar_topico_submit);
submit.Click += new System.EventHandler(submit_Click);
record = FindViewById<ImageButton>(Resource.Id.btn_gravar);
record.Click += new System.EventHandler(record_Click);
ServiceLocator.Dispatcher = new DispatchAdapter(this);
ServiceLocator.Recorder = new RecordAdapter();
timer = new System.Timers.Timer(1000);
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
timer.Enabled = true;
}
开发者ID:paulombcosta,项目名称:mono-mobilis,代码行数:27,代码来源:ResponseActivity.cs
示例7: initializeActionBar
protected void initializeActionBar(){
if(playerEnabled){
actionBar = (ActionBar) GameObject.FindObjectOfType (typeof (ActionBar));
actionBar.setPlayer(this);
actionBar.initializeBasicAttack();
}
}
开发者ID:marouen-lamiri,项目名称:Second-Soul,代码行数:7,代码来源:Player.cs
示例8: ToActionBar
/// <summary>
/// Gets the action bar for selecting the different options.
/// </summary>
public static ActionBar ToActionBar(bool isHorizontal)
{
Load();
ActionBar result = new ActionBar(isHorizontal);
AddToggles(result);
return result;
}
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:10,代码来源:FillInOptionsSerializer.cs
示例9: OnTabSelected
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
{
StationInventoryListFragment fragment = tab.Tag as StationInventoryListFragment;
if (fragment != null)
{
ft.Replace(R.Ids.stationInventoryFragmentContainer, fragment);
}
}
开发者ID:sschocke,项目名称:JGCompanion,代码行数:8,代码来源:StationInventoryActivity.cs
示例10: OnTabSelected
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
{
Fragment fragment = tab.Tag as Fragment;
if (fragment != null)
{
ft.Replace(R.Ids.itemDetailFragmentContainer, fragment);
}
}
开发者ID:sschocke,项目名称:JGCompanion,代码行数:8,代码来源:ItemDetailActivity.cs
示例11: OnHomeTabSelected
private void OnHomeTabSelected(object sender, ActionBar.TabEventArgs e)
{
var alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.SetMessage("Home tab selected!");
var dialog = alertDialogBuilder.Create();
dialog.Show();
}
开发者ID:wmeints,项目名称:Presentations,代码行数:8,代码来源:MainActivity.cs
示例12: OnTabSelected
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
{
PilotListCounterFragment fragment = tab.Tag as PilotListCounterFragment;
if (fragment != null)
{
ft.Replace(R.Ids.pilotsOnlineFragmentContainer, fragment);
}
}
开发者ID:sschocke,项目名称:JGCompanion,代码行数:8,代码来源:OnlinePilotsActivity.cs
示例13: OnTabSelected
public void OnTabSelected (ActionBar.Tab tab, FragmentTransaction ft)
{
FragmentManager.PopBackStack (null, FragmentManager.PopBackStackInclusive);
Log.Debug (Tag, "The tab {0} has been selected.", tab.Text);
Fragment frag = _fragments [tab.Position];
ft.Replace (Resource.Id.content_frame, frag);
}
开发者ID:ctsxamarintraining,项目名称:Xamarin,代码行数:8,代码来源:MainActivity.cs
示例14: AddToggles
/// <summary>
/// Adds the option toggles to the given ActionBar.
/// </summary>
public static void AddToggles(ActionBar bar)
{
foreach (IRoleFillerRule rule in AllRules)
{
IRoleFillerRule local = rule;
bar.AddToggle(local.Name, (bool b) => MarkActive(local, b), ActiveRules.Contains(local));
}
}
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:12,代码来源:FillInOptionsSerializer.cs
示例15: GetViewPageTab
public static ActionBar.Tab GetViewPageTab(this ViewPager viewPager, ActionBar actionBar, string name)
{
var tab = actionBar.NewTab();
tab.SetText(name);
tab.TabSelected += (o, e) =>
{
viewPager.SetCurrentItem(actionBar.SelectedNavigationIndex, false);
};
return tab;
}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:10,代码来源:GenericFragmentPagerAdaptor.cs
示例16: ActionBarTabsSetup
void ActionBarTabsSetup(ActionBar actionBar)
{
for (var i = 0; i < actionBar.NavigationItemCount; ++i)
{
var tab = actionBar.GetTabAt(i);
var id = GetImageFromFilename(i);
if (id != 0)
TabSetup(tab, id);
}
}
开发者ID:nodoid,项目名称:TabBarCustomViews,代码行数:10,代码来源:TabPage.cs
示例17: AddActionBar
public void AddActionBar(ActionBar actionBar)
{
if (actionBars.Count > actionBar.id) {
actionBars[actionBar.id] = actionBar.gameObject;
} else {
while (actionBars.Count < actionBar.id) {
actionBars.Add(null);
}
actionBars.Add(actionBar.gameObject);
}
UpdateActions();
}
开发者ID:zukeru,项目名称:ageofasura,代码行数:12,代码来源:Actions.cs
示例18: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.SimpleList);
coursesViewModel = new CoursesViewModel();
FindViewById<TextView>(Resource.Id.screen_title).Text = "Cursos Disponíveis";
ListView list = FindViewById<ListView>(Resource.Id.list);
adapter = new SimpleListAdapter<Course>(this, coursesViewModel.listContent);
list.Adapter = adapter;
list.ItemClick += new EventHandler<Android.Widget.AdapterView.ItemClickEventArgs>(list_ItemClick);
actionBar = SupportActionBar;
actionBar.SetHomeButtonEnabled(false);
actionBar.SetDisplayHomeAsUpEnabled(false);
actionBar.SetDisplayUseLogoEnabled(false);
actionBar.SetDisplayShowHomeEnabled(false);
actionBar.Title = "Cursos";
ServiceLocator.Messenger.Subscribe<BaseViewMessage>(m =>
{
switch (m.Content.message)
{
case BaseViewMessage.MessageTypes.CONNECTION_ERROR:
ServiceLocator.Dispatcher.invoke(() =>
{
Toast.MakeText(this, "Erro de conexão", ToastLength.Short).Show();
dialog.Dismiss();
});
break;
case BaseViewMessage.MessageTypes.CLASS_CONNECTION_OK:
ServiceLocator.Dispatcher.invoke(() =>
{
ServiceLocator.Dispatcher.invoke(() =>
{
intent = new Intent(this, typeof(ClassActivity));
StartActivity(intent);
});
});
break;
case BaseViewMessage.MessageTypes.COURSE_CONNECTION_OK:
ServiceLocator.Dispatcher.invoke(() =>
{
//TODO refresh.
});
break;
default:
break;
}
});
}
开发者ID:paulombcosta,项目名称:mono-mobilis,代码行数:50,代码来源:CoursesActivity.cs
示例19: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.SimpleList);
discussionViewModel = new DiscussionsViewModel();
FindViewById<TextView>(Resource.Id.screen_title).Text = "Fóruns Disponíveis";
ListView list = FindViewById<ListView>(Resource.Id.list);
adapter = new SimpleListAdapter<Discussion>(this, discussionViewModel.discussions);
list.Adapter = adapter;
list.ItemClick += new System.EventHandler<AdapterView.ItemClickEventArgs>(list_ItemClick);
actionBar = SupportActionBar;
actionBar.SetHomeButtonEnabled(false);
actionBar.SetDisplayHomeAsUpEnabled(false);
actionBar.SetDisplayUseLogoEnabled(false);
actionBar.SetDisplayShowHomeEnabled(false);
actionBar.Title = "Fóruns";
ServiceLocator.Messenger.Subscribe<BaseViewMessage>(m =>
{
switch (m.Content.message)
{
case BaseViewMessage.MessageTypes.CONNECTION_ERROR:
ServiceLocator.Dispatcher.invoke(() =>
{
Toast.MakeText(this, "Erro de conexão", ToastLength.Short).Show();
dialog.Dismiss();
});
break;
case BaseViewMessage.MessageTypes.FUTURE_POSTS_LOADED:
ServiceLocator.Dispatcher.invoke(() =>
{
intent = new Intent(this, typeof(PostActivity));
StartActivity(intent);
});
break;
case BaseViewMessage.MessageTypes.NO_NEW_POSTS:
ServiceLocator.Dispatcher.invoke(() =>
{
Toast.MakeText(this, "Não há novos posts", ToastLength.Short).Show();
dialog.Dismiss();
});
break;
default:
break;
}
});
}
开发者ID:paulombcosta,项目名称:mono-mobilis,代码行数:49,代码来源:DiscussionActivity.cs
示例20: TabSetup
void TabSetup(ActionBar.Tab tab, int resourceId) {
if (resourceId != 0) {
//if (Droid.OS.Build.VERSION.SdkInt > Droid.OS.BuildVersionCodes.JellyBeanMr1) {
// ImageView iv = new ImageView(activity);
// iv.SetImageResource(resourceId);
// iv.SetPadding(-25, 8, -25, 16);
// tab.SetCustomView(iv);
//} else {
tab.SetIcon(resourceId);
tab.SetText("");
//}
}
tab.TabSelected -= TabOnTabSelected;
tab.TabSelected += TabOnTabSelected;
}
开发者ID:RMDesenvolvimento,项目名称:Xamarin,代码行数:16,代码来源:TabRenderer.cs
注:本文中的ActionBar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论