Change action bar colors

前端 未结 1 921
终归单人心
终归单人心 2021-01-16 07:29

I need to change the colors of the action bar, but when I change these data in the Android app, it does not change colors dynamically (unlike in iOS).

I need when I

1条回答
  •  生来不讨喜
    2021-01-16 07:50

    You need to create a custom theme in droid/resource/styles.xml. and also need to apply this theme in your MainActivity

    Apply Theme on MainActivity

    [Activity(Label = "YourProject.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
        public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    

    Add a custom theme in Style.XML file

    
    
        
        
        
        
        
    
    

    For more understanding

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