A Textview In A Listview' S Row Cannot Click After Setting Descendantfocusability="blocksdescendants"
I write a customized item layout for a listview. The layout has many widgets and some will have its own clicklistener. When I click the row, sometimes the listview' s onListItemCli
Solution 1:
After spenting some time trying, I solved both.
the first. if your customized listview' s layout has a textview which has been set
autolink
orLinkify
in the code, the click event in the textview won' t affect the list' s row. You have to extends your ownTextView
and overrideonTouchEvent
method. please see it herethe second. just set in the customized listview' s root node:
android:descendantFocusability="blocksDescendants"
, and then, in your widget which will have its ownonClickListener
, setandroid:clickable="true"
, it works for me.
hope it useful for those you encounter the same:-)
Post a Comment for "A Textview In A Listview' S Row Cannot Click After Setting Descendantfocusability="blocksdescendants""