protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.main_activity); SetFullscreen(); view = FindViewById(Resource.Id.main_parent_view); // 액션바 toolbar = FindViewById <Toolbar>(Resource.Id.main_toolbar); SetSupportActionBar(toolbar); actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_white); actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.Title = Resources.GetString(Resource.String.ApplicationName); actionBar.Show(); TabLayoutViewPager(); NaviView(); //var position = tabLayout.SelectedTabPosition; //viewPager.SetCurrentItem(0, true); actionBar.SetBackgroundDrawable(new ColorDrawable(Resources.GetColor(Resource.Color.tab1_actionbar_background))); tabLayout.Background = new ColorDrawable(Resources.GetColor(Resource.Color.tab1_tablayout_background)); tabLayout.SetSelectedTabIndicatorColor(Resources.GetColor(Resource.Color.tab1_tabindicator_background)); }
private void SetBackground(int actionBarColorId, int tabLayoutColorId, int tabIndicatorColorId) { actionBar.SetBackgroundDrawable(new ColorDrawable(context.Resources.GetColor(actionBarColorId))); tabLayout.Background = new ColorDrawable(context.Resources.GetColor(tabLayoutColorId)); tabLayout.SetSelectedTabIndicatorColor(context.Resources.GetColor(tabIndicatorColorId)); }