I'm using a horizontal LinearLayout to divide a rectangular block of the device's screen into 3 equal parts. This is accomplished using weights.
The purpose of this is putting 3 buttons side by side, a settings button, a help button, and a contact button. As per my knowledge, it should follow that the first button in the LinearLayout is on the left, the next is in the middle, and the last is on the right, due to the hierarchy rules of a LinearLayout.
This is what the Visual Editor also shows. But when I run the application (and I've tried on multiple devices), the contact button ends up on the left, the settings button ends up in the middle, and the help button ends up on the right.
I tried changing the hierarchical structure of the code (i.e. I placed the code for contact button above the code for settings button, etc.) but it didn't make any difference to the result.
The code for the LinearLayout is below:
<LinearLayout
android:id="@+id/icons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="100">
<ImageButton
android:id="@+id/settings"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:src="@drawable/settings" />
<ImageButton
android:id="@+id/help"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:src="@drawable/help" />
<ImageButton
android:id="@+id/contact"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="33"
android:src="@drawable/contact" />
</LinearLayout>