[英]Ratingbar style in ListView, strange behavior
I use custom RatingBar style in ListView row element, but it cause some strange problem. 我在ListView行元素中使用了自定义RatingBar样式,但这会引起一些奇怪的问题。 I have got custom style like this: 我有这样的自定义样式:
<style name="RatingBar" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/course_rating_bar</item>
<item name="android:minHeight">15dip</item>
<item name="android:maxHeight">15dip</item>
</style>
And I use this in my RatingBar in xml (in layout of listView row): 我在xml的RatingBar中使用它(在listView行的布局中):
style="@style/CourseRatingBar"
But then the ListView onItemClickListener
just doesn't work. 但是然后ListView onItemClickListener
不能正常工作。 When I click on element, there is no action. 当我单击element时,没有任何动作。
When I use this as my RatingBar style: 当我将其用作我的RatingBar样式时:
style="?android:attr/ratingBarStyleSmall"
everything (onItemClickListener ;-)) works fine. 一切(onItemClickListener ;-))都可以正常工作。
The ListView use BaseAdapter with Holder pattern, with RatingBar, TextView and ImageView. ListView使用具有Holder模式的BaseAdapter,以及RatingBar,TextView和ImageView。
从我的经验来看-如果这不起作用,请尝试自定义您的评分栏如何在Android中创建自定义评分栏
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.