In my xml,
<LinearLayout
android:id="@+id/row2B"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/row2A"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/row2A"
android:orientation="vertical"
android:padding="@dimen/dp10"
android:paddingBottom="2dp"
android:splitMotionEvents="false"
android:weightSum="6" >
<ImageButton
android:id="@+id/btn_amend_all"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/transparent_btn"
android:scaleType="center"
android:splitMotionEvents="false" />
<ImageButton
android:id="@+id/btn_amend_list1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/dp2"
android:layout_weight="1"
android:background="@drawable/white_btn_border_nil"
android:scaleType="center"
android:splitMotionEvents="false"
android:src="@drawable/btn_edit_selector" />
<ImageButton
android:id="@+id/btn_amend_list2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/dp2"
android:layout_weight="1"
android:background="@drawable/white_btn_border_nil"
android:scaleType="center"
android:splitMotionEvents="false"
android:src="@drawable/btn_edit_selector" />
<ImageButton
android:id="@+id/btn_amend_list3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/dp2"
android:layout_weight="1"
android:background="@drawable/white_btn_border_nil"
android:scaleType="center"
android:splitMotionEvents="false"
android:src="@drawable/btn_edit_selector" />
<ImageButton
android:id="@+id/btn_amend_list4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/dp2"
android:layout_weight="1"
android:background="@drawable/white_btn_border_nil"
android:scaleType="center"
android:splitMotionEvents="false"
android:src="@drawable/btn_edit_selector" />
<ImageButton
android:id="@+id/btn_amend_list5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/dp2"
android:layout_weight="1"
android:background="@drawable/white_btn_border_nil"
android:scaleType="center"
android:splitMotionEvents="false"
android:src="@drawable/btn_edit_selector" />
</LinearLayout>
Screenshot:
on the left is a RadioGroup inside row2A, and the code is row2B, alignTop and bottom of row2A.
Question:
Referencing to What is android:weightSum in android, and how does it work?, I would like to have the 6 buttons spread equally in height, but why the above cannot achieve the purposes?
Thanks in advance!