How do I style appcompat-v7 Toolbar like Theme.AppCompat.Light.DarkActionBar?

后端 未结 7 1540
猫巷女王i
猫巷女王i 2020-11-30 16:46

I\'m trying to recreate the look of Theme.AppCompat.Light.DarkActionBar with the new support library Toolbar.

If I choose Theme.AppCompat.Light

7条回答
  •  长情又很酷
    2020-11-30 17:42

    The cleanest way I found to do this is create a child of 'ThemeOverlay.AppCompat.Dark.ActionBar'. In the example, I set the Toolbar's background color to RED and text's color to BLUE.

    
    

    You can then apply your theme to the toolbar:

    
    

提交回复
热议问题