2

I am trying to create an Option Menu with checkboxes. However, for some reason, the checked checkboxes are white. Which makes them very hard to see on the light gray background. I don't know why they are white. The text and the unchecked checkboxes are dark gray. I've been trying to make them the same color as the unchecked boxes but couldn't figure out how. Here is a screenshot of them:

Screenshot

And this is what my menu.xml looks like:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <group
        android:checkableBehavior="all">
        <item
            android:id="@+id/location"
            android:title="@string/menuUseLocation"
            android:checked="true"
            app:showAsAction="never" />
        <item
            android:id="@+id/map"
            android:title="@string/menuUseHypridMap"
            android:checked="false"
            app:showAsAction="never" />
        <item
            android:id="@+id/vibration"
            android:title="@string/menuUseVibration"
            android:checked="true"
            app:showAsAction="never" />
    </group>
</menu>

I am using this 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>

And these colors:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#da121a</color>
    <color name="colorPrimaryDark">#000000</color>
    <color name="drawerBackground">#da121a</color>
    <color name="colorAccent">#F4F4F4</color>
    <color name="background">#F4F4F4</color>
    <color name="text">#FFFFFF</color>
</resources>

Any ideas about how to fix this problem?

arne.z
  • 3,242
  • 3
  • 24
  • 46
  • Which accent_color you have used? – Nitin Karande Dec 03 '16 at 16:20
  • 1
    This answer might help. http://stackoverflow.com/questions/5854047/how-to-change-the-color-of-a-checkbox – mattfred Dec 03 '16 at 16:30
  • @NitinKarande: I added my the Theme I am using and my `colors.xml`. You were right about the `colorAccent`. If you post it as an answer, I will accept it. Thanks for your help! – arne.z Dec 03 '16 at 18:23

1 Answers1

2

As per your code snippets and screenshot . I will suggest to change your acentColor

ColorAccent will be display in your checkBox selected value in those you have given in accentColor in your style.

I hope it will work.

Nitin Karande
  • 1,280
  • 14
  • 33