android 清单中的主题
Theme in android manifest
我该如何合并
android:theme="@android:style/Theme.Material.Light"
和
android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
在 android-manifest.xml 或 values/style.xml?
您需要从第二个中取出相关属性并将它们添加到第一个中。您可以通过扩展 styles.xml.
中的第一个主题来做到这一点
在主题中添加 NoActionBar 的示例如下:
<!-- Base application theme. -->
<style name="BaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme" parent="BaseTheme"/>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
取自此处:
https://github.com/Austin-Android/austin-feeds-me/blob/master/app/src/main/res/values/styles.xml
您只能在标签中扩展单亲。您已经确定了第二个所需的样式属性并应用如下内容。
<style name="Themelight" parent="Theme.AppCompat.Light">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/colorAccent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:background">@color/colorPrimary</item>
<item name="android:windowFullscreen">true</item>
</style>
参考android开发者文档中样式继承相关https://developer.android.com/guide/topics/ui/look-and-feel/themes.html#Inheritance
我该如何合并
android:theme="@android:style/Theme.Material.Light"
和
android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
在 android-manifest.xml 或 values/style.xml?
您需要从第二个中取出相关属性并将它们添加到第一个中。您可以通过扩展 styles.xml.
中的第一个主题来做到这一点在主题中添加 NoActionBar 的示例如下:
<!-- Base application theme. -->
<style name="BaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme" parent="BaseTheme"/>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
取自此处:
https://github.com/Austin-Android/austin-feeds-me/blob/master/app/src/main/res/values/styles.xml
您只能在标签中扩展单亲。您已经确定了第二个所需的样式属性并应用如下内容。
<style name="Themelight" parent="Theme.AppCompat.Light">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/colorAccent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:background">@color/colorPrimary</item>
<item name="android:windowFullscreen">true</item>
</style>
参考android开发者文档中样式继承相关https://developer.android.com/guide/topics/ui/look-and-feel/themes.html#Inheritance