XML : Have two LinearLayouts have equal height using layout_weight, not working

I am having difficulty getting these two LinearLayouts nested in a single LinearLayout to have equal height. The first LinearLayout has 0 height while the second takes up the entire screen.

Not sure if it's important but I programmatically populate the second LinearLayout with buttons.

XML

  <LinearLayout      android:id="@+id/remote_ctrl_ll"      android:orientation="vertical"      android:layout_width="match_parent"      android:layout_height="wrap_content"      android:weightSum="2">        <LinearLayout          android:id="@+id/terminal_ll"          android:orientation="vertical"          android:layout_width="match_parent"          android:layout_height="0dp"          android:layout_weight="1"          android:background="@drawable/terminal_window"></LinearLayout>        <LinearLayout          android:orientation="vertical"          android:layout_width="match_parent"          android:layout_height="0dp"          android:layout_weight="1"          android:id="@+id/remote_gesture_btns_ll"          android:gravity="center">      </LinearLayout>  </LinearLayout>    

No comments:

Post a Comment