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://ift.tt/nIICcg">
<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>

No comments:

Post a Comment