Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide shadow of rating bar

Customizing RatingBar shows me shadow

How to hide this shadow ?

enter image description here

           <RatingBar
            android:id="@+id/ratingBarMain"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/textView6"
            android:layout_toRightOf="@+id/imgThumbFix"
            android:clickable="false"
            android:progressDrawable="@drawable/ratingbar_red_small"
            android:stepSize="1" />
like image 336
MAC Avatar asked Jul 11 '12 10:07

MAC


3 Answers

set

android:layout_height="EQUAL_TO_IMAGE_HEIGHT"

example

android:layout_height="35dp"
like image 122
Chintan Raghwani Avatar answered Oct 04 '22 01:10

Chintan Raghwani


The problem here is:

It is repeating the last bit line of the image if the height of your View is 50 px and the height of image is 40 px, then for rest of the 10 px it will be filled by repeating the last bit of your image.

You have to give the exact height equals to your image height to RatingBar.

android:layout_height="40dp" 

Same problem was solved here

like image 40
Adil Soomro Avatar answered Oct 04 '22 00:10

Adil Soomro


Another simple solution woud be to leave a row of empty pixels in the star image using an image editor like photoshop. Then the repeated or stretched row of pixels in the ratingbar would be empty. This aproach solved my issue.

like image 24
evis Avatar answered Oct 04 '22 00:10

evis