Custom Checkable View which responds to Selector

前端 未结 6 654
生来不讨喜
生来不讨喜 2021-01-30 23:11

I have a group of FrameLayout which I want to be checkable/selectable,

That is, after a click I would like the FrameLayout to display as

6条回答
  •  耶瑟儿~
    2021-01-30 23:46

    Try reordering tags in your selector_horizontal.xml These are evaluated top to bottom. It seems that in your case either android:state_pressed="false" or android:state_pressed="true" is applied and evaluation never reaches third line with android:state_checked="true" Try moving first line to last:

    
    
    
    

提交回复
热议问题