Change status bar color with AppCompat ActionBarActivity

后端 未结 7 1605
一个人的身影
一个人的身影 2020-11-29 17:04

In one of my Activities, I changed the Toolbar color using Palette. But on 5.0 devices using ActionBarActivity the status bar color i

相关标签:
7条回答
  • 2020-11-29 17:48

    Thanks for above answers, with the help of those, after certain R&D for xamarin.android MVVMCross application, below worked

    Flag specified for activity in method OnCreate

    protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            this.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
        }
    

    For each MvxActivity, Theme is mentioned as below

     [Activity(
        LaunchMode = LaunchMode.SingleTop,
        ScreenOrientation = ScreenOrientation.Portrait,
        Theme = "@style/Theme.Splash",
        Name = "MyView"
        )]
    

    My SplashStyle.xml looks like as below

    <?xml version="1.0" encoding="utf-8"?>
    <resources> 
        <style name="Theme.Splash" parent="Theme.AppCompat.Light.NoActionBar">
              <item name="android:statusBarColor">@color/app_red</item>
              <item name="android:colorPrimaryDark">@color/app_red</item>
        </style>
     </resources>
    

    And I have V7 appcompact referred.

    0 讨论(0)
提交回复
热议问题