Android 安卓-材料设计不影响安卓
我想在我的应用程序中使用材料设计。我创建了一个新项目 在格拉德尔:Android 安卓-材料设计不影响安卓,android,Android,我想在我的应用程序中使用材料设计。我创建了一个新项目 在格拉德尔: android { compileSdkVersion 23 buildToolsVersion "23.0.1" defaultConfig { applicationId "XXXXXXX" minSdkVersion 8 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release {
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "XXXXXXX"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
}
风格:
<style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
</style>
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
符合事实的
错误的
@颜色/原色
@颜色/原色暗
@颜色/颜色重音
值-21->样式:
<style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
<item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
<item name="android:windowSharedElementExitTransition">@android:transition/move</item>
</style>
符合事实的
符合事实的
符合事实的
@android:过渡/移动
@android:过渡/移动
舱单:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/MyMaterialTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
这是android 5之前的版本:
如您所见,colorPrimaryDark在以下位置不起作用
我所做的是错的吗?您确定仿真器在API 21上运行吗?它看起来更像19(KitKat),其中colorPrimaryDark不会为状态栏着色。colorPrimaryDark将在API 22(5.1.1)上工作