为Android使用预先编写的主题
这简直让我发疯,可能真的很简单 我知道如何在我的应用程序中更改主题。我想我只需要更改为Android使用预先编写的主题,android,android-theme,Android,Android Theme,这简直让我发疯,可能真的很简单 我知道如何在我的应用程序中更改主题。我想我只需要更改AndroidManifest.xml中的这一行: android:theme="@style/AppTheme" 只需将AppTheme更改为values/styles.xml中的任何主题即可 但是,我的styles.xml文件很无聊: <style name="AppBaseTheme" parent="android:Theme.Light"> </style> <styl
AndroidManifest.xml
中的这一行:
android:theme="@style/AppTheme"
只需将AppTheme
更改为values/styles.xml
中的任何主题即可
但是,我的styles.xml
文件很无聊:
<style name="AppBaseTheme" parent="android:Theme.Light">
</style>
<style name="AppTheme" parent="AppBaseTheme">
</style>
也就是说,我认为没有主题
我在哪里下载主题?我需要什么。。可能是styles.xml
和一些资产(例如图像)。我主要是一个后端程序员,我只想要比默认主题更有趣的东西
谢谢。据我所知,你不能下载预先编写的android主题。您可以使用internet上的一些代码片段为自己制作一个styles.xml。例如,下面的代码是一个自定义主题:
<resources>
<!-- Base application theme is the default theme. -->
<style name="Theme" parent="android:Theme">
</style>
<!-- Variation on our application theme that has a translucent
background. -->
<style name="Theme.Translucent">
<item name="android:windowBackground">@drawable/translucent_background</item>
<item name="android:windowNoTitle">true</item>
<item name="android:colorForeground">#fff</item>
</style>
<!-- Variation on our application theme that has a transparent
background; this example completely removes the background,
allowing the activity to decide how to composite. -->
<style name="Theme.Transparent">
<item name="android:windowBackground">@drawable/transparent_background</item>
<item name="android:windowNoTitle">true</item>
<item name="android:colorForeground">#fff</item>
</style>
<style name="TextAppearance.Theme.PlainText" parent="android:TextAppearance.Theme">
<item name="android:textStyle">normal</item>
</style>
</resources>
@可绘制/半透明背景
真的
#fff
@可绘制/透明背景
真的
#fff
正常的
将此内容放在values文件夹的styles.xml文件中。更改彩色前景
等以创建自己的主题。在drawable文件夹中添加您自己的图像,并在此处引用它们,依此类推