创建于2019-05-27
1. 在styles中用一对<style>标签写一种style
例如默认的:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
2. 在manifest中指定
<activity
android:name=".FruitActivity"
android:theme="@style/FruitActivityTheme">
</activity>
3.如果需要考虑版本兼容:
res目录下新建一个values-v21目录,在里面单独写:
<resources>
<style name="FruitActivityTheme" parent="AppTheme">
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
网友评论