巴扎黑2017-04-17 16:45:09
What effect do you want to achieve? Or have you encountered this problem and want to find out the cause? If you want to monitor the click event of the sub-View, you should set up monitoring on the sub-View instead of monitoring the ViewGroup. The click event is an independent event and cannot be distributed. As for the SeekBar changing color after clicking the ViewGroup, it is because the click event will also trigger the touch event. The touch event is distributed by default. The touch event brings focus, and with focus, the color changes. As a digression, your relative layout is not written rigorously. The attribute layout_wight, which only takes effect in linear layout, should not appear in relative layout
高洛峰2017-04-17 16:45:09
Viewgroup's onTouchEvent returns true, which means intercepting and processing the event. In this way, the subview will not receive event notifications and will not respond to the event. It is also recommended to understand the three functions of view events