码迷,mamicode.com
首页 > 其他好文 > 详细

初识RatingBar

时间:2014-12-26 06:13:27      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:

RatingBar,SeekBar和ProgressBar的子类

1 <RatingBar
2             android:id="@+id/ratingBar2"
3             android:layout_width="wrap_content"
4             android:layout_height="wrap_content"
5             android:numStars="6"
6             android:rating="1.5"
7             android:stepSize="0.5" />

RatingBar事件处理

 1 public void showRatingBar() {
 2 
 3         ratingBar = (RatingBar) findViewById(R.id.ratingBar1);
 4         ratingBar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
 5 
 6             @Override
 7             public void onRatingChanged(RatingBar ratingBar, float rating,
 8                     boolean fromUser) {
 9                 // TODO Auto-generated method stub
10                 Log.i(TAG, "rating is " + rating);
11             }
12         });
13     }

 

初识RatingBar

标签:

原文地址:http://www.cnblogs.com/izhanjun/p/4185947.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!