我正在使用样式评级小部件,它在某些设备上显示良好,但有一些设备的问题,如HTC 我的xml是:
<LinearLayout android:layout_width="fill_parent"
android:id="@+id/linearLayout3"
android:gravity="left|center_vertical|center_horizontal"
android:orientation="horizontal"
android:layout_height="wrap_content">
<RatingBar android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5" android:stepSize="0.1"
android:layout_weight="0.1"
style="?android:attr/ratingBarStyleIndicator"
android:id="@+id/ratingbar_incident"
android:isIndicator="false"/>
<TextView android:id="@+id/textViewVote"
android:layout_height="wrap_content"
android:layout_marginLeft="1dip"
android:textColor="@color/black"
android:text="(0 votes)" android:layout_width="wrap_content"/>
</LinearLayout>
。
如何解决此问题?
答案 0 :(得分:2)
首先你要注意style="?android:attr/ratingBarStyleIndicator"
The smaller RatingBar style ( ratingBarStyleSmall) and the larger indicator-only style (
的 ratingBarStyleIndicator
强> ) do not support user interaction and should only be used as indicators.
另外:
When using a RatingBar that supports user interaction, placing widgets to the
的 left or right of the RatingBar is discouraged.
强>``