I’m developing an Android 3.1 tablet application.
In this application I will have a landscaped screen with two galleries and I want that those two galleries have 50% width.
This is my layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/frag_general_info_factory_table"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_margin="10dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
[ ... ]
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dip"
android:weightSum="1"
android:orientation="vertical">
<Gallery
android:id="@+id/factGallery"
android:layout_weight=".5"
android:layout_width="0dip"
android:layout_height="fill_parent"/>
<Gallery
android:id="@+id/wareHouseGallery"
android:layout_weight=".5"
android:layout_width="0dip"
android:layout_height="fill_parent"/>
</LinearLayout>
[ ... ]
</LinearLayout>
But it doesn’t look well.
How can I do it?
I’m assuming you want them side by side horizontally, in which case you have the orientation of the LinearLayout wrong – it should be set to horizontal: