如何使用评级栏?

问题描述 投票:0回答:1

我想保存评级栏评级明星的状态?我该怎么做呢?以及如何获得用户选择的星数?要在textView中显示?谢谢

android textview rating
1个回答
0
投票

来自developer.android.com:

http://developer.android.com/resources/tutorials/views/hello-formstuff.html#RatingBar

其他例子在这里..

http://android-er.blogspot.com/2010/02/ratingbar.html

如果你想自定义RatingBar,例如。显示除默认星之外的其他图像参考How to create Custom Ratings bar in Android

此示例显示用户选择评级时的Toast消息。显然,你必须根据自己的需要进行自定义(正如你所说,你想在TextView中显示它)。

您可以在xml文件中定义TextView并在Rating更改时设置其text属性。

© www.soinside.com 2019 - 2024. All rights reserved.