title: Cannot change width and number of stars of RatingBar
body: <p>I am trying to set a <code>RatingBar</code> with only 5 stars but it expands to fill the width of the screen.</p>
  
  <p>I have found similar problems:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3858600/how-to-make-ratingbar-to-show-five-stars/10819710">How to make RatingBar to show five stars</a></li>
  <li><a href="https://stackoverflow.com/questions/12454644/android-ratingbar-a-complete-mess?rq=1">Android RatingBar - a complete mess</a></li>
  <li><a href="https://stackoverflow.com/questions/12724376/android-rating-bar-xml-and-numstars?rq=1">android rating bar xml and numStars </a></li>
  </ul>
  
  <p>However, most of the time the solution is to set the width to <code>wrap_content</code> but the width for me has always been <code>wrap_content</code>.</p>
  
  <p>This is my layout. If you scroll right to the bottom you'll see the two <code>RatingBar</code>s:</p>
  
  <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;TableLayout
          android:id="@+id/add_spot_layout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:shrinkColumns="1"
          android:stretchColumns="1" &gt;
  
          &lt;TableRow
              android:layout_marginBottom="2sp"
              android:layout_marginTop="2sp" &gt;
  
              &lt;TextView android:text="Distance:" /&gt;
  
              &lt;TextView android:id="@+id/distancePopup" /&gt;
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:layout_marginBottom="2sp"
              android:layout_marginTop="2sp" &gt;
  
              &lt;TextView android:text="Address:" /&gt;
  
              &lt;TextView android:id="@+id/addrPopup" /&gt;
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:layout_marginBottom="2sp"
              android:layout_marginTop="2sp" &gt;
  
              &lt;TextView android:text="Type:" /&gt;
  
              &lt;TextView android:id="@+id/typePopup" /&gt;
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:layout_marginBottom="2sp"
              android:layout_marginTop="2sp" &gt;
  
              &lt;TextView android:text="Terrain:" /&gt;
  
              &lt;RatingBar
                  android:id="@+id/terrainPopup"
                  style="?android:attr/ratingBarStyleSmall"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:isIndicator="true"
                  android:max="5"
                  android:numStars="5"
                  android:stepSize="1" /&gt;
          &lt;/TableRow&gt;
  
          &lt;TableRow&gt;
  
              &lt;TextView android:text="Difficulty:" /&gt;
  
              &lt;RatingBar
                  android:id="@+id/difficultyPopup"
                  style="?android:attr/ratingBarStyleSmall"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:isIndicator="true"
                  android:max="5"
                  android:numStars="5"
                  android:stepSize="0.1" /&gt;
          &lt;/TableRow&gt;
  
          &lt;TableRow
              android:layout_marginBottom="2sp"
              android:layout_marginTop="2sp" &gt;
  
              &lt;TextView android:text="Description:" /&gt;
  
              &lt;TextView
                  android:id="@+id/descPopup"
                  android:gravity="top"
                  android:lines="2"
                  android:maxLines="2"
                  android:scrollHorizontally="false" /&gt;
          &lt;/TableRow&gt;
      &lt;/TableLayout&gt;
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>This is what it looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/OV4o1.png" alt=""></p>