Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的客户想要在其中一项活动中使用评级栏,但他不希望它允许半星(又名浮动)值。我一直在谷歌搜索,但一无所获。有谁知道是否可以强制评分栏不允许半星?
提前致谢。
应该能够使用setStepSize()并使用 a1.0来允许增加 1 星而不是0.5半星
setStepSize()
1.0
0.5
这是关于它的文档。
它也可以在 xml 中设置,使用
android:stepSize="1"
尝试像这样设置步长
ratingBar.setStepSize(1.0);