1. Review
Learn about the knowledge of Android layout optimization, and SeekBar (draggable scroll bar) for understanding and learning
2. Focus
(1) Realization of Ratingbar
(2) Realization of Onratingbarchangelistener
3. Implement3.1
3.2 Layout Implementation
<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools " android:layout_width=" match_parent " android:layout_height=" Match_parent " tools:context= "${relativepackage}.${activityclass}" > <ratingbar android:id= "@+id/rating_ Bar1 " android:layout_width=" wrap_content " android:layout_height=" wrap_content " android:layout_ Alignparentleft= "true" android:layout_below= "@+id/btn_debug" android:layout_margintop= "28DP"/>< /relativelayout>
3.3 Onratingbarchangelistener implementation
The initialization control (Findviewbyid) is not said;
Using Toast display
Class Rating_bar1listener implements onratingbarchangelistener{@Overridepublic void onratingchanged (Ratingbar Ratingbar, float Rating,boolean fromuser) { toast.maketext (this,rating+ "star", Toast.length_short). Show (); }}
3.4 Binding Listener Events
Rating_bar1.setonratingbarchangelistener (New Rating_bar1listener ());
4. Demo Free point Download
Gift Toast Full solution!!!
http://download.csdn.net/detail/lablenet/9047139
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android-Basic Control (Ratingbar implementation)