ActionBar 不会更改为 Holo 或 Dark
ActionBar doesn´t change to Holo or Dark
我正在尝试自定义我的 ActionBar,我遵循 Android 开发人员的教程 --> Link,但它没有改变,我在 [=30] 中指定了主题=] 清单:
android:theme="@android:style/Theme.Holo" and, in my styles.xml:
而且我还更改了我的 styles.xml:
<style name="AppTheme" parent="Theme.AppCompat">
</style>
此外,我有最新版本的库:
并且在我的 App Grandle 中引用了它:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.cheescake.juno"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
`proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}
我按照所有步骤操作,但我不知道为什么我的 ActionBar 还处于主题灯状态。也许可能是一个愚蠢的错误,我不明白什么,但我有 2 天的时间来解决这个问题 =(
谢谢!
指定主题颜色后,例如:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
....
</style>
将以下行添加到 AndroidManifest.xml
文件
<application
...
android:theme="@style/AppTheme" >
....
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@android:color/white</item>
</style>
并且在清单文件中
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
我正在尝试自定义我的 ActionBar,我遵循 Android 开发人员的教程 --> Link,但它没有改变,我在 [=30] 中指定了主题=] 清单:
android:theme="@android:style/Theme.Holo" and, in my styles.xml:
而且我还更改了我的 styles.xml:
<style name="AppTheme" parent="Theme.AppCompat">
</style>
此外,我有最新版本的库:
并且在我的 App Grandle 中引用了它:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.cheescake.juno"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
`proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}
我按照所有步骤操作,但我不知道为什么我的 ActionBar 还处于主题灯状态。也许可能是一个愚蠢的错误,我不明白什么,但我有 2 天的时间来解决这个问题 =(
谢谢!
指定主题颜色后,例如:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
....
</style>
将以下行添加到 AndroidManifest.xml
文件
<application
...
android:theme="@style/AppTheme" >
....
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@android:color/white</item>
</style>
并且在清单文件中
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"