自定义评级栏中星星之间的间距
Spacing between the stars of a rating bar?
I have similar problem but I didn't find solution to make it without changes of images.
Maybe someome faced with such problem and solved it.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建使用您自己的图像且图像之间具有不同间距的自定义样式。
在这样的布局中使用它:
像这样定义样式:
将 minHeight 设置为可绘制对象的高度。
然后,将 ic_ rating_star_large 定义为如下所示的图层列表:
Create a custom style that uses your own images with different spacing between them.
Use it in a layout like this:
Define the style like this:
Set the minHeight to whatever the height of your drawable is.
Then, define ic_rating_star_large as a layer list like this:
您的评级栏是否使用相同类型的代码?
// ?android:attr/ ratingBarStyle- 普通星形
// ?android:attr/ ratingBarStyleSmall - 小星形
Are you using this same kind of code for your rating bar?
// ?android:attr/ratingBarStyle- normal star
// ?android:attr/ratingBarStyleSmall - small star