Simple GUI Design (1)
RelativeLayout And LinearLayout Example
main.xml
*********
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<RelativeLayout
android:background="@drawable/relative"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_width="match_parent"
android:layout_height="150dp">
<ImageView
android:id="@+id/ff"
android:background="@drawable/eer"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_width="100dp"
android:layout_height="150dp"/>
<TextView
android:id="@+id/gg"
android:layout_marginTop="25dp"
android:layout_toRightOf="@+id/ff"
android:textColor="#FF2806FF"
android:text="Bhone Myint Myat Aung"
android:textSize="17dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<TextView
android:id="@+id/kkg"
android:layout_marginTop="50dp"
android:layout_toRightOf="@+id/ff"
android:textColor="#FFFF0000"
android:text="***************************"
android:textSize="17dp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<Button
android:text="More To Click Me"
android:textColor="#FF246F03"
android:background="@drawable/jjkl"
android:layout_marginRight="10dp"
android:layout_marginBottom="25dp"
android:layout_marginTop="80dp"
android:layout_toRightOf="@+id/ff"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
</RelativeLayout>
(drawable to)
relative.xml
************
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <!-- solid background --> <solid android:color="#FFFFFF"/> <!-- draw a border around rectangle shape --> <stroke android:color="#ffe21720" android:width="1dp" /> <!-- draw 35 dp radius for each corner --> <corners android:radius="10dp"/> </shape> </item> </selector>
Note. . .( jjkl.xml to drawable)
Bhone Myint Myat Aung

No comments:
Post a Comment