Quantcast
Channel: Android Step-by-Step
Viewing all articles
Browse latest Browse all 25

How to Add Rating Bar, in XML

$
0
0
RatingBar was added in API Level 1
A RatingBar is an extension of SeekBar and ProgressBar that shows a rating in stars. The user can touch/drag or use arrow keys to set the rating when using the default size RatingBar.




1. In the main.xml file, add the below code after your layout tags.

<RatingBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
 />

2. Compile and run!

Next Recommended Article: android:id - How to Name a Rating Bar, in XML

Resources:
http://developer.android.com/reference/android/widget/RatingBar.html


Viewing all articles
Browse latest Browse all 25

Latest Images

Trending Articles



Latest Images