控件: RatingBar
显示:TextView
方法: RatingBar.setOnRatingBarChangeListener类的onRatingChanged()方法。
XML:
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/ratingBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:numStars="4"
android:rating="2.25"
android:stepSize="0.25" />
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"