【发布时间】:2015-04-07 22:36:26
【问题描述】:
我目前在我的应用程序中使用通常令人惊叹的appcompat-v7 库,我正在尝试在不更改Toolbar 中的图标颜色的情况下为CheckBoxes 着色(如后退箭头或那三个点) .
按照它目前的外观 - 你可以看到不仅 CheckBox 被染成粉红色,后向箭头/三个点也被染成粉红色。
我的代码:
布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:background="?colorPrimary"
android:elevation="4dp" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="My CheckBox" />
</LinearLayout>
应用程序主题
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#FFC107</item>
<item name="colorPrimaryDark">#FFA000</item>
<item name="android:textColorPrimary">#FFF</item>
<item name="android:textColorSecondary">#FFF</item>
<item name="colorControlNormal">#E91E63</item>
</style>
问题
我需要进行哪些更改才能使复选框变为粉红色而工具栏内容保持为白色?
旁注: 我想主要问题是我根本找不到描述每个 appcompat 属性的页面。这基本上只是全面的试验和错误,因为这些属性的名称没有明确的指示。
【问题讨论】:
-
@Arlind 我只是看了看,但不幸的是它不起作用。自定义
checkboxStyle适用于textColor但不适用于 CheckBox 本身的颜色。
标签: android android-appcompat material-design