Headertab

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Thursday 8 October 2015

Hello Guys

Today we are learn about the xml design.
If you face adjusting of TextView and ImageView type of issues the follow below design.....

<?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="wrap_content"
    android:orientation="vertical">

<LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal">
            <TableLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <TableRow
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:weightSum="4">
                    <RelativeLayout
                        android:id="@+id/layout_Views"
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_margin="2dp"
                        android:layout_weight="1"
                        android:background="@color/blue">
                        <TextView
                            android:id="@+id/txt_viewCount"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_centerInParent="true"
                            android:gravity="center"
                            android:padding="9dp"
                            android:text="214 Views"
                            android:textColor="#fff" />
                    </RelativeLayout>
                    <RelativeLayout
                        android:id="@+id/layout_Votes"
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_margin="2dp"
                        android:layout_weight="1"
                        android:background="@color/red">
                        <TextView
                            android:id="@+id/txt_Votes"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_centerInParent="true"
                            android:gravity="center"
                            android:padding="9dp"
                            android:text="214 Views"
                            android:textColor="#fff" />
                    </RelativeLayout>
                    <RelativeLayout
                        android:id="@+id/layout_share"
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_margin="2dp"
                        android:layout_weight="1"
                        android:background="@color/green">
                        <ImageView
                            android:id="@+id/img_share"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_centerInParent="true"
                            android:src="@drawable/ic_share" />
                    </RelativeLayout>
                    <RelativeLayout
                        android:id="@+id/layout_bookmark"
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_margin="2dp"
                        android:layout_weight="1"
                        android:background="@color/yellow">
                        <ImageView
                            android:id="@+id/img_boomark"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_centerInParent="true"
                            android:src="@drawable/ic_bookmark" />
                    </RelativeLayout>
                </TableRow>
            </TableLayout>
        </LinearLayout>


</LinearLayout>

See Output ...
Enjoy guys.