我在试着玩RatingBar,但有些地方真的不对劲。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<RatingBar
android:id="@+id/shoppingitem_rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:rating="0"
style="?android:attr/ratingBarStyleSmall"
/>
</LinearLayout>这是我的布局XML。这导致了一个带有白色矩形的黑色视图(这并不小,我可以补充一句)。怎么一回事?
截图如下:
screenshot
发布于 2010-08-06 05:14:39
这就是布局编辑器显示它们的方式。它坏了。你能展示你初始化ratingbar的代码吗?
发布于 2011-02-17 08:06:54
尝试将LinearLayout的android:layout_width="fill_parent"更改为"wrap_content"。
https://stackoverflow.com/questions/3419032
复制相似问题