Screen 1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/LinearLayout"
android:text="LinearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/button1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="this is a button 1"/>
<Button
android:id="@+id/button2"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="this is a button 2"/>
</LinearLayout>
Screen 2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/LinearLayout"
android:text="Linear Layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/button1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="this is a button 1"/>
<Button
android:id="@+id/button2"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="this is a button 2"/>
</LinearLayout>
Screen 3
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/LinearLayout"
android:text="Linear Layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/button1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="width set to fill_parent"/>
<Button
android:id="@+id/button2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="width set to wrap_content"/>
</LinearLayout>
Screen 4
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/LinearLayout"
android:text="Linear Layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/button1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="2"
android:text="weight set to 2"/>
<Button
android:id="@+id/button2"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="1"
android:text="weight set to 1"/>
</LinearLayout>
Screen 5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/LinearLayout"
android:text="Linear Layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:id="@+id/row1"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="left"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/row2"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center">
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="center"/>
</LinearLayout>
<LinearLayout
android:id="@+id/row3"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="center_vertical"/>
</LinearLayout>
<LinearLayout
android:id="@+id/row4"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal">
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="center_horizontal"/>
</LinearLayout>
<LinearLayout
android:id="@+id/row5"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="right"/>
</LinearLayout>
<LinearLayout
android:id="@+id/row6"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom">
<Button
android:id="@+id/button6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="bottom"/>
</LinearLayout>
</LinearLayout>
Screen 6
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="right"
android:text="android layout gravity=right"/>
<Button
android:id="@+id/button2"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:gravity="right"
android:text="android gravity=right"/>
</LinearLayout>
Screen 7
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="button 1"/>
<Button
android:id="@+id/button2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:gravity="right|center_vertical"
android:text="button 2"/>
</LinearLayout>
No comments:
Post a Comment