tags:

views:

47

answers:

1

Hi,

I'm trying to play around with a RatingBar, but something is really wrong.

<?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>

Here is my layout XML. This results in a black view with a white rectangle (that is not small, I might add). What is going on?

Here is a screenshot:

screenshot

A: 

That is just how the layout editor show them. It's busted. Can you show the code where you initialize the ratingbar?

CaseyB
I don't have any Java code. At this point I just have the RatingBar tag in XML to show it on the screen. It looks fine in the emulator, but there are 20 stars even though I've specified 5.
Andrew
I suspect the number of stars is in the small style's file and is overriding my specification of 5? How can I get around this?
Andrew