如何设置的RatingBar星星的自定义尺寸 [英] How to set the custom size of the stars in RatingBar

查看:1577
本文介绍了如何设置的RatingBar星星的自定义尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经添加了一个样式

<style name="myRatingBar" parent="@android:style/Widget.RatingBar">
    <item name="android:minHeight">32dp</item>
    <item name="android:maxHeight">32dp</item>
</style>

不过,而不是缩放明星我收到冒出星星:

However instead of scaled stars I'm receiving cropped stars:

有没有办法来改变恒星的大小?

Is there a way to change the size of the stars?

推荐答案

Android将不会缩放等级栏中的图标。当你降低了minHeight和Android的了maxHeight总会裁剪图标上所示的图片。解决办法为它似乎是唯一的解决方案是提供自己的图标恒星所需的尺寸,并设置了minHeight和向了maxHeight的图标的大小。

Android won't scale a rating bar icons. When you decrease the minHeight and maxHeight android will always crop the icons as shown on the picture. The workaround for it and seems to be the only one solution is to provide your own icons for stars with the desired dimensions and set the minHeight and maxHeight to the size of the icons.

这篇关于如何设置的RatingBar星星的自定义尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆