protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); adapter = new MyIconPagerAdapter(SupportFragmentManager); pager = FindViewById<ViewPager>(Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip>(Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager(pager); var pageMargin = (int) TypedValue.ApplyDimension(ComplexUnitType.Dip, 4, Resources.DisplayMetrics); pager.PageMargin = pageMargin; pager.CurrentItem = 1; tabs.OnTabReselectedListener = this; tabs.OnPageChangeListener = this; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); ChangeColor(Resources.GetColor(Resource.Color.green)); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); adapter = new MyIconPagerAdapter(SupportFragmentManager); pager = FindViewById <ViewPager>(Resource.Id.pager); tabs = FindViewById <PagerSlidingTabStrip>(Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager(pager); var pageMargin = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 4, Resources.DisplayMetrics); pager.PageMargin = pageMargin; pager.CurrentItem = 1; tabs.OnTabReselectedListener = this; tabs.OnPageChangeListener = this; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); ChangeColor(Resources.GetColor(Resource.Color.green)); }