Saturday, 4 April 2015

Scaling a ratingBar in a listview causes a leftward shift. How to get the ratingBar back to the right edge?



I have a listView with two rating bars which are using a 50x50 pixel image and has to be re-sized to 50% original size to fit both on the right side of a single row. However when re-sizing it shifts the rating Bars to the left away from the edge of the row where I would like them to be. Any help is greatly appreciated as I have looked over this site and others to no avail.



...

<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentEnd="true"
android:id="@+id/linearLayout2">

<RatingBar
style="@style/sodaRatingBar"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:scaleX="0.5"
android:scaleY="0.5"
android:gravity="right"
android:id="@+id/ratingBar"
android:numStars="5"
android:longClickable="false"
android:indeterminateOnly="false" />

...


If you need a picture I can supply a screencap. Also, I could resize the star images I am using in the rating bar but I thought that the standard android size was around 50x50.


No comments:

Post a Comment