Common Android Views Cheat Sheet

ADVERTISEMENT

Common Android Views
TextView
<TextView
android:id="@+id/title_text_view"
Displays text
android:layout_width="wrap_content"
My Photos
android:layout_height="wrap_content"
android:text="@string/my_photos"
android:textAppearance="?android:textAppearanceLarge"
android:textColor="#4689C8"
android:textStyle="bold"
/>
ImageView
<ImageView
android:id="@+id/photo_image_view"
Displays Image
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/beach"
/>
Button
<Button
android:id="@+id/next_button"
Button with text label
android:layout_width="wrap_content"
android:layout_height="wrap_content"
NEXT
android:text="@string/next"
/>
View
<View
android:layout_width="match_parent"
Plain rectangle (can be used as
android:layout_height="100dp"
android:background="#4E4B4F"
/>
a divider)
EditText
<EditText
android:id="@+id/album_description_view"
Text field that you can type into
android:layout_width="match_parent"
Album Desciption
android:layout_height="wrap_content"
android:hint="@string/album_description"
android:inputType="textMultiLine"
/>
Spinner
<Spinner
Beach
Beach
android:id="@+id/sort_by_spinner"
Click on it to show a list
android:layout_width="match_parent"
BBQ
android:layout_height="wrap_content"
/>
of dropdown options
Family dinner
Create SpinnerAdapter in Java code to populate the
options.
See more
Party

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 3