Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overlaying a view does not disable actions on underlying view

I have 2 views : View A and view B. View A is rendered and has actions to input a text value. Im displaying an overlay view - View B on top of this. I expect that the actions on View A get disabled but they do not and im still able to type in the input field on View A. How can i disable this ?

like image 974
lokoko Avatar asked May 19 '14 06:05

lokoko


1 Answers

The reason is that your overlay is not consuming the touch events , so by design if a view is not consuming touch events the events are passed to underlying view in the view model. So the long answer is make your overlay touchable, focusable , and touch listener and return true . short answer is add android:clickable="true" to your overlay view.

like image 193
nizammoidu Avatar answered Nov 11 '22 21:11

nizammoidu