9 patch selector

I am trying to create a selector in CheckBox and replace the android: button with a selector. In the selector, I had two 9patch images, but for some reason this does not work well. 9patch images are ok. This is the selector code:

<selector android:constantSize="false"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="false"
       android:drawable="@drawable/bopen" />

    <item android:state_checked="true" 
     android:drawable="@drawable/bclose" />

    <item android:drawable="@drawable/bclose" />
</selector>

What can I do?

+3
source share
1 answer

The second line is missing the state of the selector, so you can see the problem with the selector, right?

0
source

Source: https://habr.com/ru/post/1775132/


All Articles