Edittext 有一些奇怪的颜色
Editext has some strange color
您好,我有一些 EditTexts 在 19+ 版本中显示正常,但在 19 及更低版本中我得到了这个结果。 editText image
这是我的代码:
<EditText
android:id="@+id/player_name_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name_hint"
android:contentDescription="@string/a11y_enter_player_name"
android:fontFamily="sans-serif-light"/>
这是我的 styles.xml
<resources>
<!-- Base application theme. -->
<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>
<style name="DargetTheme" parent="AppTheme" />
<!-- Toolbar theme -->
<style name="ToolbarTheme" parent="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorPrimary">@color/colorWhite</item>
</style>
<!-- Settings activity theme. -->
<style name="SettingsTheme" parent="DargetTheme" />
任何帮助都会很棒!谢谢!
这是 Android studio 2.2 preview 的 Bug,已在 Android studio preview 4 和 5
中解决
我建议您将 gradle 更新为新版本
Android studio 2.2 预览版 4 或 5
http://tools.android.com/recent/androidstudio22preview4available
或者您使用 Gradle 2.1.0
classpath 'com.android.tools.build:gradle:2.1.0'
您好,我有一些 EditTexts 在 19+ 版本中显示正常,但在 19 及更低版本中我得到了这个结果。 editText image
这是我的代码:
<EditText
android:id="@+id/player_name_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/name_hint"
android:contentDescription="@string/a11y_enter_player_name"
android:fontFamily="sans-serif-light"/>
这是我的 styles.xml
<resources>
<!-- Base application theme. -->
<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>
<style name="DargetTheme" parent="AppTheme" />
<!-- Toolbar theme -->
<style name="ToolbarTheme" parent="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorPrimary">@color/colorWhite</item>
</style>
<!-- Settings activity theme. -->
<style name="SettingsTheme" parent="DargetTheme" />
任何帮助都会很棒!谢谢!
这是 Android studio 2.2 preview 的 Bug,已在 Android studio preview 4 和 5
中解决我建议您将 gradle 更新为新版本
Android studio 2.2 预览版 4 或 5
http://tools.android.com/recent/androidstudio22preview4available
或者您使用 Gradle 2.1.0
classpath 'com.android.tools.build:gradle:2.1.0'