【发布时间】:2014-11-21 14:08:03
【问题描述】:
我正在尝试升级我的应用程序以支持棒棒糖前设备上的材料设计,为此我添加了 android 支持库 v7 并将我的应用程序的样式从 android:Theme.Holo.Light.DarkActionBar 更改为 Theme.AppCompat.NoActionBar。现在我的 MainActivity 扩展了支持库的 ActionBarActivity 以及这个我已经将我的操作栏更改为工具栏。
直到这里一切正常,它显示了带有动画的新抽屉切换图标,但在我的整个应用程序中,所有文本颜色已从 Black 更改为 White现在我不知道我必须从哪里改变。我必须在每个布局中更改它吗?
我正在使用具有以下配置的 Android Studio。
Build.gradle
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
}
dependencies {
compile "com.android.support:appcompat-v7:21.0.+"
}
Style.xml
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">false</item>
</style>
Layout.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/TopLevelActivity">
<LinearLayout
android:id="@+id/layout"
style="@style/Default"
android:orientation="vertical">
<TextView
android:id="@+id/name_label"
style="@style/SectionHeader.First"
android:text="@string/name"/>
<TextView
android:id="@+id/name"
style="@style/Text.SingleLine" />
<TextView
android:id="@+id/email_label"
style="@style/SectionHeader"
android:text="@string/email" />
<TextView
android:id="@+id/email"
style="@style/Text.SingleLine" />
<TextView
android:id="@+id/app_version_label"
style="@style/SectionHeader"
android:text="@string/app_version" />
<TextView
android:id="@+id/app_version"
style="@style/Text.SingleLine" />
<TextView
android:id="@+id/customer_support_label"
style="@style/SectionHeader"
android:visibility="gone"
android:text="@string/customer_support" />
<TextView
android:id="@+id/customer_support_phone"
style="@style/Text.SingleLine"
android:visibility="gone"
android:autoLink="all" />
<TextView
android:id="@+id/customer_support_email"
style="@style/Text.SingleLine"
android:visibility="gone"
android:autoLink="all" />
<Switch
android:id="@+id/alarm_service_toggle"
android:layout_marginTop="@dimen/small_padding"
style="@style/Default" />
<TextView
style="@style/Text.SingleLine"
android:textColor="@android:color/tertiary_text_light"
android:text="@string/switch_location_sub_message" />
<Button
android:id="@+id/capture_logs"
style="@style/Default"
android:layout_marginTop="@dimen/medium_padding"
android:text="@string/capture_logs" />
<Button
android:id="@+id/logout"
style="@style/Default"
android:layout_marginTop="@dimen/medium_padding"
android:text="@string/logout" />
</LinearLayout>
</ScrollView>
如果需要我提供任何其他输入,请告诉我。
【问题讨论】:
标签: android textview material-design