Also adding layout_gravity to the button could help.

On Wed, Mar 17, 2010 at 4:27 PM, Kitzy <kitzyk...@gmail.com> wrote:
> I'm not 100% sure on your problem, but you could simplify thing
> emenssly by using a RelativeLayout, and that may help you problem at
> the same time.
>
> See: 
> http://developer.android.com/resources/articles/layout-tricks-efficiency.html
>
> -Kitzy
>
> On Mar 10, 6:24 am, Sven Jacobs <sven.jac...@web.de> 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 Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to