简体   繁体   中英

how to set different background color of different screens - Android?

I'm creating two different themes black and white. In one of the themes, Its completely black background. But in other theme, I am going to use two different background colors for two different screens (layouts).
For example, first screen red color and second, and third are white colors.
I'm stuck there. Please help me to do it.
Thanks in advance.

Define several themes with android:windowBackground set to the different colors and then call setTheme() in your activity's onCreate() . These themes can inherit from your main app theme.

There should be different XML files for different pages/screens. These can be found in res -> layout . After opening the XML file you want, click on the "Graphical Layout" tab. Then click on the page. Then you will see a list of settings/properties for the layout, the bottom left of the screen. From here you can change whatever you want :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM