如何使用评分栏?
我想保存评级栏评级星星的状态吗?我该怎么做呢? 另外我将如何获取用户选择的星星数量?要显示在文本视图中? 谢谢
i would like to save the state of rating bar rating stars? How would i go about doing this?
and also how would i go about getting the number of stars the user has selected? To display in a textView?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自developer.android.com:
http://developer.android .com/resources/tutorials/views/hello-formstuff.html#RatingBar
这里的其他示例..
http://android-er.blogspot.com/2010/02/ ratingbar.html< /a>
如果你想自定义RatingBar,例如。显示默认星形以外的其他图像
请参阅如何在Android中创建自定义评级栏
此示例在用户选择评级时显示
Toast
消息。&显然,您必须根据您的需要自定义它(正如您所说的,您想要在 TextView 中显示它)。
您可以在 xml 文件中定义一个
TextView
当评级更改时设置其文本属性。From developer.android.com :
http://developer.android.com/resources/tutorials/views/hello-formstuff.html#RatingBar
Other Example Here..
http://android-er.blogspot.com/2010/02/ratingbar.html
If you want to customize RatingBar eg. Displaying other image than default Star
refer How to create Custom Ratings bar in Android
This example shows
Toast
message when user selects Ratings.& Obviously you will have to customize it according to your needs (as you told you want to display it in TextView).
You can define a
TextView
in xml file & set its text property when Rating has changed.