void AddTabToActionBar(string tabTitle) { ActionBar.Tab tab = ActionBar.NewTab().SetText(tabTitle); tab.TabSelected += TabOnTabSelected; ActionBar.AddTab(tab); }
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); }