I answer this question after 4-5 years, but it is best done below
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <LinearLayout android:id="@+id/firstLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_toLeftOf="@+id/secondView" android:orientation="vertical"></LinearLayout> <View android:id="@+id/secondView" android:layout_width="0dp" android:layout_height="match_parent" android:layout_centerHorizontal="true" /> <LinearLayout android:id="@+id/thirdLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_toRightOf="@+id/secondView" android:orientation="vertical"></LinearLayout> </RelativeLayout>
This is the right approach, since using layout_weight is always very difficult for UI operations. Splitting the layout using LinearLayout is not good practice
silwar May 26 '15 at 9:35 2015-05-26 09:35
source share