Placing A Button in linear layout

Put your problem here if it does not fit any of the other categories.

Placing A Button in linear layout

Postby ananddr » Fri Oct 23, 2009 11:37 am

Hi all,
I am trying to create a Linear layout with one TextView component,one EditText component,one Button.
I am using the following XML code in the main.xml file:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_width="fill_parent"
  8.  
  9.    android:layout_height="fill_parent"
  10.  
  11.    >
  12.  
  13.     <TextView android:id="@+id/address"
  14.  
  15.              android:layout_width="fill_parent"
  16.  
  17.              android:layout_height="wrap_content"
  18.  
  19.              android:text="Type the Web Address here:" />
  20.  
  21.  
  22.  
  23.     <EditText android:id="@+id/entry"
  24.  
  25.              android:layout_width="fill_parent"
  26.  
  27.              android:layout_height="wrap_content"
  28.  
  29.              android:background="@android:drawable/editbox_background" />
  30.  
  31.  
  32.  
  33.     <Button android:id="@+id/go"
  34.  
  35.            android:layout_width="wrap_content"
  36.  
  37.            android:layout_height="wrap_content"
  38.  
  39.            android:layout_below="@id/entry"
  40.  
  41.            android:layout_alignParentRight="true"
  42.  
  43.            android:layout_marginLeft="10px"
  44.  
  45.            android:text="GO" />
  46.  
  47.              
  48.  
  49. </LinearLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


The output of the above XML file is as shown in the "browser.jpg" attachement given below.


But I want to place the button on the right side of the Edit Text component as shown in the "target.jpg" attachment given below.


How the XML file can be changed so that the button is placed as shown in the above figure.
Can any one help me on this???

Thanks in advance,
Anand.
Attachments
target.jpg
TARGET
target.jpg (7.5 KiB) Viewed 278 times
browser.jpg
BROWSER
browser.jpg (6.34 KiB) Viewed 278 times
Last edited by ananddr on Tue Oct 27, 2009 2:23 pm, edited 1 time in total.
ananddr
Freshman
Freshman
 
Posts: 7
Joined: Tue Sep 22, 2009 3:12 pm

Top

Postby qlimax » Mon Oct 26, 2009 12:28 pm

can't see pictures :(
¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 11 guests