开发者

item of listView obtain focus and click events

开发者 https://www.devze.com 2023-01-06 18:37 出处:网络
i have a lisyView,every item(every row ) have a imageView and a textView,when i scroll the listView,the whole item gets the focus,but for every item , frist i want toimageViewgets focus,then textViews

i have a lisyView,every item(every row ) have a imageView and a textView,when i scroll the listView,the whole item gets the focus,but for every item , frist i want to imageView gets focus,then textViews get focus,so that i can h开发者_运维问答andle the click events of imageView,so my questtion is how to get the focus of imageView .


To capture clickEvents of a View, you can do a couple different things.

In the XML layout definition of the ImageView, you can specify which method to invoke on a click via the following:

http://developer.android.com/reference/android/view/View.html#attr_android:onClick

Or you can set on OnClickListener on the ImageView.

http://developer.android.com/reference/android/view/View.html#setOnClickListener(android.view.View.OnClickListener)

http://developer.android.com/reference/android/view/View.OnClickListener.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号