Common Android Views Cheat Sheet Page 2

ADVERTISEMENT

Common Android Views
CheckBox
<CheckBox
android:id="@+id/notify_me_checkbox"
Checkbox with text label
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Notify me
android:text="@string/notify_me"
android:textAppearance="?android:textAppearanceMedium"
/>
RadioButton
<RadioGroup
android:layout_width="wrap_content"
Radio button (where you can
android:layout_height="wrap_content"
android:orientation="vertical">
select one out of a group of
<RadioButton
radio buttons)
android:id="@+id/yes_radio_button"
android:layout_width="wrap_content"
Yes
android:layout_height="wrap_content"
android:text="@string/yes"
No
android:textAppearance="?android:textAppearanceMedium"
/>
<RadioButton
android:id="@+id/no_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no"
android:textAppearance="?android:textAppearanceMedium"
/>
</RadioGroup>
RatingBar
<RatingBar
android:id="@+id/rating_bar"
Star rating
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:rating="2.5"
android:stepSize="0.5"
/>
Switch
<Switch
android:id="@+id/backup_photos_switch"
On / off switch that you can drag
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Auto backup photos
right or left (or just tap to toggle
android:text="@string/auto_backup_photos"
the state)
android:textAppearance="?android:textAppearanceSmall"
/>
SeekBar
<SeekBar
android:id="@+id/seek_bar"
Displays progress and allows you
android:layout_width="match_parent"
android:layout_height="wrap_content"
to drag the handle anywhere in
android:max="100"
the bar (i.e. for music or video
android:progress="20"
/>
player)

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 3