difference between `focusable` and `clickable`

橙三吉。 提交于 2019-12-03 08:04:21

问题


What is the difference between clickable and focusable in android?


回答1:


Clickable means that it can be clicked by a pointer device or be tapped by a touch device. Focusable means that it can gain the focus from an input device like a keyboard. Input devices like keyboards cannot decide which view to send its input events to based on the inputs itself, so they send them to the view that has focus.




回答2:


Focusable means ACTION_UP event will occur. It will gain it and it won't release it.

Clickable means ACTION_UP first and ACTION_DOWN at the end. It will gain and release it at the end.



来源:https://stackoverflow.com/questions/14049292/difference-between-focusable-and-clickable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!