Android Layout(user Interface)
Hi i want to develop a UI like image, is it possible in android,if possible , how can we do that?(i need lines(horizontal and vertical) between images like image).
Solution 1:
Using LinearLayout
this layout is very simple.
Try below code
<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:weightSum="4"android:orientation="vertical" ><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:gravity="center_horizontal|center_vertical"android:layout_weight="1"android:orientation="horizontal" ><ImageViewandroid:id="@+id/imageView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@drawable/ic_launcher" /><TextViewandroid:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="20dp"android:text="Find Dishes"android:textAppearance="?android:attr/textAppearanceLarge" /></LinearLayout><Viewandroid:layout_width="fill_parent"android:layout_height="3dp"android:background="@android:color/black" /><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:gravity="center_horizontal|center_vertical"android:layout_weight="1"android:orientation="horizontal" ><ImageViewandroid:id="@+id/imageView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@drawable/ic_launcher" /><TextViewandroid:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginLeft="20dp"android:text="Recomanded Dishes"android:textAppearance="?android:attr/textAppearanceLarge" /></LinearLayout><Viewandroid:layout_width="fill_parent"android:layout_height="3dp"android:background="@android:color/black" /><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:layout_weight="1"android:weightSum="2" ><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_weight="1"android:gravity="center_horizontal"android:orientation="vertical" ><ImageViewandroid:id="@+id/imageView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@drawable/ic_launcher" /><TextViewandroid:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="follow people"android:textAppearance="?android:attr/textAppearanceLarge" /></LinearLayout><Viewandroid:layout_width="3dp"android:layout_height="fill_parent"android:background="@android:color/black" /><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_weight="1"android:gravity="center_horizontal"android:orientation="vertical" ><ImageViewandroid:id="@+id/imageView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@drawable/ic_launcher" /><TextViewandroid:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="View Profile"android:textAppearance="?android:attr/textAppearanceLarge" /></LinearLayout></LinearLayout><Viewandroid:layout_width="fill_parent"android:layout_height="3dp"android:background="@android:color/black" /><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:layout_weight="1"android:weightSum="2" ><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_weight="1"android:gravity="center_horizontal"android:orientation="vertical" ><ImageViewandroid:id="@+id/imageView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@drawable/ic_launcher" /><TextViewandroid:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Notifications"android:textAppearance="?android:attr/textAppearanceLarge" /></LinearLayout><Viewandroid:layout_width="3dp"android:layout_height="fill_parent"android:background="@android:color/black" /><LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_weight="1"android:gravity="center_horizontal"android:orientation="vertical" ><ImageViewandroid:id="@+id/imageView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:src="@drawable/ic_launcher" /><TextViewandroid:id="@+id/textView1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Sign up/Sign-In"android:textAppearance="?android:attr/textAppearanceLarge" /></LinearLayout></LinearLayout></LinearLayout>
After using this code my output is like this
change image and background according to your requirement.
Post a Comment for "Android Layout(user Interface)"