Hide shadow of rating bar

落爺英雄遲暮 提交于 2019-12-06 00:19:58

问题


Customizing RatingBar shows me shadow

How to hide this shadow ?

           <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" />

回答1:


set

android:layout_height="EQUAL_TO_IMAGE_HEIGHT"

example

android:layout_height="35dp"



回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/11430367/hide-shadow-of-rating-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!