1

stars with shadows increasingly offset

Im showing a basic dialog API 21+ in which a ratingbar is being shown. It works fine on most devices but on some others it's being displayed like in the image.

I tried setting the height to 48dp, and setting the secondaryProgressTint to transparent.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:orientation="vertical"
    android:padding="16dp">
    <RatingBar
        android:id="@+id/rate_this_app"
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:max="5"
        android:numStars="5"
        android:progressTint="@color/red"
        android:rating="5"
        android:secondaryProgressTint="@android:color/transparent"
        android:stepSize="1" />

</LinearLayout>

I just want to eliminate those background shadows. I don't understand where they're comimg from, I'm not using any custom drawables for the stars.

Virg
  • 53
  • 7
  • You could try using the [`clipToPadding`](https://stackoverflow.com/questions/40377782/android-xml-drop-shadow-cut-off) property to correct this. – Mapsy Dec 29 '18 at 00:33
  • 1
    Does your dialog has a transparent background? I wonder if this is some weird effect due to the elevation inherent in a dialog. If so, setting a white dialog background or setting elevation to 0dp might do the trick. – stkent Dec 29 '18 at 02:46

0 Answers0