Try using the android:layout_gravity xml parameter.

On Mar 10, 12:49 pm, Sven Jacobs <[email protected]> wrote:
> Hi all,
>
> this is the first time I'm developing an Android app so please bear with me
> ;)
>
> I've put an EditText and Button into a horizontal LinearLayout but
> unfortunately the button is not aligned with the text field. In the
> Hierarchy Viewer the text field has a absolute_y of 30 while the button has
> 32. Please see screenshots of the Hierarchy Viewer 
> here:http://picasaweb.google.com/sj1981/Android
>
> The XML looks like this:
>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
>               android:orientation="vertical"
>               android:layout_width="fill_parent"
>               android:layout_height="fill_parent"
>               >
>     <LinearLayout
>         android:orientation="horizontal"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         android:layout_marginTop="5sp">
>         <EditText
>             android:id="@+id/search_text"
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:layout_weight="1"
>             android:hint="@string/search_hint"
>             android:singleLine="true"
>             />
>         <Button
>             android:id="@+id/search_button"
>             android:layout_width="wrap_content"
>             android:layout_height="wrap_content"
>             android:drawableLeft="@drawable/magnifier"
>             />
>     </LinearLayout>
>     <LinearLayout
>         android:id="@+id/results_container"
>         android:orientation="vertical"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         />
> </LinearLayout>
>
> What's the problem here?
>
> Many thanks,
> Sven

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to