缩小评级栏大小时出现问题。
我想减小评级栏的大小,我有一些样式属性可以做到这一点,但它们超出了用户交互的范围,它们只是指示器。所以,请告诉我如何缩小尺寸。提前致谢。
I want to reduce the size of the Rating bar, I got some style properties that do it, but they are out of the reach of user interaction they are just Indicator. So, please let me know how to reduce the size. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如何粘合此处给出的代码 ...
第 1 步。您需要在
res/drawable
... 中添加自己的评级星星第 2 步 在
res/drawable
中,您需要ratingstars .xml
如下...第 3 步 在
res/values
中,您需要styles.xml
如下 ...Step- 4 在您的布局中...
尝试 Activity ....
使用此布局
product.xml
...How to glue the code given here ...
Step-1. You need your own rating stars in
res/drawable
...Step-2 In
res/drawable
you needratingstars.xml
as follow ...Step-3 In
res/values
you needstyles.xml
as follow ...Step-4 In your layout ...
Try Activity ....
With this layout
product.xml
...我在这里搜索了很多有同样问题的帖子,我正在尝试 @Vaibhav A 提供的答案Jani,当我刚刚停下来解决这个问题时。我并不是说 @Vaibhav A. Jani 答案不正确。
试试这个,它对我来说可以看到小得多的星星:
而且我还能够动态创建大量的RatingBar,无需接触任何xml文件,只需java编码。
< em>参考
I've searched through a lot of posts with the same question here and I was trying out the answer provided by @Vaibhav A. Jani, when I just stopped by a more simple solution to this question. I am not saying that @Vaibhav A. Jani answer is not correct tho.
Try this, it worked for me to see stars much smaller:
And also I was able to create lots of RatingBar dynamically, without touching any xml file, just java coding.
Reference
尝试改变风格
Try changing style
工作代码:
您可以轻松减小评级栏星星的大小
只需在xml中添加如下
android:scaleX="0.5" android:scaleY="0.5"
Working Code :
You can easily reduce size of rating bar stars
Just add in xml as below
android:scaleX="0.5" android:scaleY="0.5"