问题
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