public override void initToolBar()
        {
            //mToolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            //mCollapsingToolbarLayout = FindViewById<CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
            //mVideoPreview = FindViewById<ImageView>(Resource.Id.video_preview);
            //mSlidingTabLayout = FindViewById<SlidingTabLayoutPlus>(Resource.Id.tab_layout);
            //mViewPager = FindViewById<ViewPager>(Resource.Id.view_pager);
            //mFAB = FindViewById<FloatingActionButton>(Resource.Id.fab);
            //mAppBarLayout = FindViewById<AppBarLayout>(Resource.Id.app_bar_layout);
            //mTvPlayer = FindViewById<TextView>(Resource.Id.tv_player);
            //mAvText = FindViewById<TextView>(Resource.Id.tv_av);

            mToolbar.Title = "";//.setTitle("");
            SetSupportActionBar(mToolbar);

            Android.Support.V7.App.ActionBar supportActionBar = this.SupportActionBar;// SupportActionBar;// GetSupportActionBar();
            if (supportActionBar != null)
            {
                supportActionBar.SetDisplayHomeAsUpEnabled(true);//  .setDisplayHomeAsUpEnabled(true);
                //supportActionBar.Hide();
            }
            //设置还没收缩时状态下字体颜色
            mCollapsingToolbarLayout.SetExpandedTitleColor((int)Color.Transparent);
            //设置收缩后Toolbar上字体的颜色
            mCollapsingToolbarLayout.SetCollapsedTitleTextColor((int)Color.White);
            //设置StatusBar透明

            SystemBarHelper.ImmersiveStatusBar(this);

            SystemBarHelper.SetHeightAndPadding(this, mToolbar);

            //Sys
            mAvText.Text = ("av" + av);
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_test);//.test.layout.activity_main2);
            CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout)FindViewById(Resource.Id.collapsing_toolbar_layout);

            //ImageView iv = (ImageView)FindViewById(Resource.Id.iv);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            toolbar.SetNavigationIcon(Resource.Mipmap.category);
            collapsingToolbarLayout.Title = "TEST";                               // setTitle("CollapsingToolbarLayout");
            collapsingToolbarLayout.SetCollapsedTitleTextColor((int)Color.White); //setCollapsedTitleTextColor(Color.WHITE);
            collapsingToolbarLayout.SetExpandedTitleColor((int)Color.White);
            // Create your application here
        }