Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <!--By default the LinearLayout is using orientation : vertical, so all of the
- View will be created in vertical order-->
- <!--Study the View attributes and their features, Every attributes are unique.
- Try to experiment on your own!-->
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Hello World"
- android:textColor="#ff0000"
- android:textSize="32sp"
- android:textStyle="italic" />
- <Button
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:drawableLeft="@mipmap/ic_person"
- android:text="click here !"
- android:textSize="32sp" />
- <!--LinearLayout below is using orientation : horizontal, wrapping 2 EditText.
- By creating another LinearLayout with different orientation, the order of the View
- inside of this LinearLayout will change from vertical to horizontal-->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <!--We are using weight : 1 on each View to divide the weight of the View to 1:1
- related to the maximum width of the screen-->
- <EditText
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:hint="Input Alphabet Here"
- android:inputType="textCapWords" />
- <EditText
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:hint="Input Number Here"
- android:inputType="number" />
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <CheckBox
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:checked="true"
- android:text="Menggambar" />
- <CheckBox
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Menulis" />
- </LinearLayout>
- <!--RadioGroup is acting like a parent for RadioButton because users can only choose 1
- options on RadioButton, without RadioGroup the RadioButton can be chosen more than 1-->
- <RadioGroup
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <RadioButton
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:checked="true"
- android:text="Android" />
- <RadioButton
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="iOS"
- android:textColor="@color/merah" />
- </RadioGroup>
- <!--If you have an error in the entries attribute, it's probably you haven't create
- a new string-array in Res > values > strings.xml
- Ask your mentor on how to create it!-->
- <Spinner
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:entries="@array/spinner">
- </Spinner>
- <!--If you have an error in the android:src don't panic! it's because you don't
- have the image as i do :D. You can use your own image or you can use same image,
- download it here : https://drive.google.com/open?id=1IrCxRpOVI34vJwTTcL2gJ-i8zpGwJMQm-->
- <ImageView
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scaleType="centerCrop"
- android:src="@drawable/androidparty" />
- </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement