Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid custom RatingBar image artifacts
    primarykey
    data
    text
    <p>I implemented a custom <code>RatingBar</code> in an application on my <code>ListView</code> items. Custom style <strong>ratingbar_red.xml</strong>:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:id="@android:id/background" android:drawable="@drawable/star_off" /&gt; &lt;item android:id="@android:id/secondaryProgress" android:drawable="@drawable/star_on" /&gt; &lt;item android:id="@android:id/progress" android:drawable="@drawable/star_on" /&gt; &lt;/layer-list&gt; </code></pre> <p>Here's part of ListItem layout:</p> <pre><code>&lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingLeft="15dp" &gt; &lt;RatingBar android:id="@+id/li_company_rating" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:layout_marginBottom="1dp" android:isIndicator="true" android:numStars="5" android:progressDrawable="@drawable/ratingbar_red" android:stepSize="1" /&gt; &lt;Button android:id="@+id/li_company_callbtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="0dp" android:layout_marginLeft="40dp" android:contentDescription="@string/ContentDescription" android:drawableLeft="@drawable/phone_icon" android:drawablePadding="5dp" android:onClick="callbtn_Click" android:text="@string/CallButton" android:focusable="false" android:focusableInTouchMode="false" &gt; &lt;/Button&gt; &lt;/LinearLayout&gt; </code></pre> <p>It works, but when the rating is set, I get some strange image artifacts; 2 vertical lines below the pink stars appear on my view: </p> <p><img src="https://i.stack.imgur.com/bhJ4t.png" alt="enter image description here"></p> <p>Here is <strong>star_on.png</strong> </p> <p><img src="https://i.stack.imgur.com/aaz3k.png" alt="link"></p> <p><strong>star_off.png</strong> looks okay, and if rating == 0, the lines don't appear.</p> <p>I'm android beginner, and can't understand what the problem is.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload