1
我添加了一個actionBar選項卡到我的項目的一個片段,但其中一個選項卡不顯示文本。該選項卡顯示,我可以單擊該選項卡,但該選項卡上沒有文本或圖標。這裏是代碼:Xamarin Android ActionBar選項卡 - 1選項卡不顯示文本
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
{
HasOptionsMenu = true;
var ignored = base.OnCreateView (inflater, container, savedInstanceState);
this.Activity.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;
var tab = this.Activity.ActionBar.NewTab();
tab.SetText ("List"); //this one not showing up
tab.SetIcon (Resource.Drawable.Icon);
var tab2 = this.Activity.ActionBar.NewTab();
tab.SetText ("Map");
tab.SetIcon (Resource.Drawable.Icon);
var view = inflater.Inflate(Resource.Layout.OffersLayout, null);
tab.TabSelected += delegate {
//some stuff
};
tab2.TabSelected += delegate {
//some stuff
};
this.Activity.ActionBar.AddTab (tab);
this.Activity.ActionBar.AddTab (tab2);
任何想法我在做什麼錯在這裏?