How I align two spinners evenly?(%50-%50)

android, android-layout

Solution

use weight sum in Linear layout .....

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:weightSum="1" >

    <Spinner
        android:id="@+id/spinner1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight=".5" />

    <Spinner
        android:id="@+id/spinner2"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight=".5" />

</LinearLayout>

Problem

I mean I have one line and I want to put 2 spinner in there with horizontal. I want to put them evenly. But I dont set it.When I set it 3,3 inc screens , it is problem with other screens because I use dp . What do I use? Lineerlayout or relative? Anad How I set them? Thanks. ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Spinner android:id="@+id/spinner1" android:layout_width="309dp" android:layout_height="wrap_content" /> <Spinner android:id="@+id/spinner2" android:layout_width="match_parent" android:layout_height="wrap_content" /> </LinearLayout> ``` THIS IS IMG TO SHOW MY PROBLEM : http://img4host.net/viewer.php?img=220942354fe421eb92ec5

Original source