Consistent UI color in all Android devices

前端 未结 2 690
眼角桃花
眼角桃花 2021-01-13 22:17

I noticed the UI color (eg Button background/text color) all changes from device to device, based on the current theme that is being used in a device.

What is the be

2条回答
  •  轮回少年
    2021-01-13 22:42

    Best practice is to apply a custom theme to your application, and override as much of the default properties as you need.

    Almost everything can be changed, except

    • The Menu
    • Some properties of AlertDialog (these can be changed using a custom dialog)
    • OS provided views such as the Quick Search Bar (QSB)

    If you like the look of the default SDK resources then you can find these in sdk_folder/platforms/android-9/data/res/ (replace 9 with the SDK version you want the resources from) - copy the ones you want into your App and reference those.

    You can take a look at the theme the SDK uses:

    • themes.xml
    • styles.xml

提交回复
热议问题