List item becomes unclickable if contains a RatingBar?

混江龙づ霸主 提交于 2019-12-10 12:51:55

问题


I have used custom listview and custom rating bar.

If I add that custom RatingBar as child to the List item, the List Item becomes unclickable.

If i remove that Ratingbar view then it becomes clickable .

I used custom rating bar. here is the link.

Can anyone help me to solve this problem?


回答1:


If you want your rating bar to perform rating you can add

 android:focusable="false"
 android:focusableInTouchMode="false"

to view of your row.xml

If you want a static rating bar holding its rate you can give setIsIndicator(boolean isIndicator)

ratingbar.setIsIndicator(true);

in your Adapter class.




回答2:


Ok. I'm able to do it finally. In adapter class put fallowing

RatingBar ratingBar=(RatingBar)view.findViewById(R.id.ratingBarSummaryChild);

ratingBar.setFocusable(false);

return view;




回答3:


set android:focusable="false" for rating bar




回答4:


Set RatingBar propertiesa Focusable = false; Clickable = false;



来源:https://stackoverflow.com/questions/11031763/list-item-becomes-unclickable-if-contains-a-ratingbar

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