Custom Checkable View which responds to Selector

前端 未结 6 632
生来不讨喜
生来不讨喜 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:52

    In addition to Graeme's answer above do the following modification to toggle()

    @Override
    public void toggle() {
        mChecked = !mChecked;
        refreshDrawableState();
    }
    

提交回复
热议问题