I want to create a custom Radio Button.
I using with <selector>
and <layer-list>
to show small circle on large circle, when the user select it.
But it seems to ignore the <size>
tag completely!
My code is bellow:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false">
<shape>
<size android:width="40dp" android:height="40dp"></size>
<corners android:radius="5dp"></corners>
<solid android:color="@color/blue"/>
</shape>
</item>
<item android:state_checked="true">
<layer-list>
<item>
<shape>
<size android:width="40dp" android:height="40dp"/>
<corners android:radius="5dp"/>
<solid android:color="@color/blue"/>
</shape>
</item>
<item>
<shape>
<size android:width="20dp" android:height="20dp"/>
<corners android:radius="5dp"/>
<solid android:color="@color/white"/>
</shape>
</item>
</layer-list>
</item>
I've seen this problem a lot, and the only solution I found is:
If you have a better solution - answer!