protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SupportActionBar.NavigationMode = ActionBar.NavigationModeTabs; SetContentView (Resource.Layout.Main); content = FindViewById<ViewPager> (Resource.Id.content_frame); content.Adapter = tabsAdapter = new TabAdapter (SupportFragmentManager); content.SetOnPageChangeListener (this); AddTabToActionBar (Resource.String.events_tab_label, Resource.Drawable.calendar); AddTabToActionBar (Resource.String.animals_tab_label, Resource.Drawable.gorilla); //AddTabToActionBar (Resource.String.about_tab_label, Resource.Drawable.ic_action_whats_on); }
protected override void OnCreate(Bundle savedInstanceState) { // setting up and drawer base.OnCreate(savedInstanceState); var layout = LayoutInflater.Inflate(Resource.Layout.TapTest, null); var tablayout = layout.FindViewById<TabLayout>(Resource.Id.tab_layout); var viewpager = layout.FindViewById<ViewPager>(Resource.Id.view_pager); var adapter = new TabAdapter(this, viewpager, tablayout); // Sets the content of the tabs adapter.AddTab(Resource.String.event_menu_recommended, new RecommendsFragment()); adapter.AddTab(Resource.String.event_menu_joined, new AttendingFragment()); adapter.AddTab(Resource.String.event_menu_hosted, new HostingFragment()); tablayout.GetTabAt(Intent.GetIntExtra("tab", 0)).Select(); SupportActionBar.Elevation = 0; // Removes the shadow between the actionbar and tab bar, as per Google Material Design Guidelines. Content.AddView(layout); }