I am trying to use layout_weight in a Linear Layout but it is not setting up proper layout .It's all getting mixed up .proper gap in not there in each textview .Please help me to fix this .
XML
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainResultLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:baselineAligned="false" android:orientation="horizontal" > <LinearLayout android:id="@+id/linearLayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:id="@+id/request_date" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="25 Sep 2013 | 09:45" android:layout_gravity="left"/> <TextView android:id="@+id/approval_id" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="XXXXXXXX" android:layout_gravity="right" /> <TextView android:id="@+id/trip_date" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="25 Sep 2013" android:layout_gravity="right" /> <TextView android:id="@+id/trip_id" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="XXXXXXXXXX" android:layout_gravity="right" /> <TextView android:id="@+id/approval_status" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="Waiting" android:layout_gravity="right" /> </LinearLayout> </LinearLayout> So please help to fix this issue will be thank full to you..