I want to style a ToggleButton
that I placed in my ActionBar
but I can't seem to do so. I have tried to apply a simple background to it but that doesn't seem to work. I tried to follow this: Android toggle button custom look but that didn't seem to work Here was my attempt:
create_post_menu.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".CreatePost">
<item
android:id="@+id/toggle_test"
android:title="Private"
app:showAsAction="always"
android:orderInCategory="1"
android:background="@drawable/pick_out_line"
app:actionViewClass="android.widget.ToggleButton" />
</menu>
pick_out_line.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/white" android:state_checked="true" />
<item android:drawable="@color/white" android:state_pressed="true" />
<item android:drawable="@color/colorPrimary" />
</selector>