selector not working with layout and image view

前端 未结 5 1766
你的背包
你的背包 2021-02-01 07:10

I want to use selector for a layout and image view..But it is not working for me. When I changed image view to imagebutton or button, it works fine. Any help will be greatly app

5条回答
  •  青春惊慌失措
    2021-02-01 07:27

    I ran into this problem just now. You'll have to set the LinearLayout to clickable. You can either do this in the XML with

    android:clickable="true"
    

    Or in code with

    yourLinearLayout.setClickable(true);
    

提交回复
热议问题