开发者

item of listView obtain focus and click events

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜