<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView1" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="Linear Layout with EditText and Button"
android:paddingTop="15dp" />
<LinearLayout android:layout_width="match_parent"
android:id="@+id/linearLayout1" android:layout_height="wrap_content">
<EditText android:layout_weight="1" android:id="@+id/editText1"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:hint="you can type here ..."/>
<Button android:id="@+id/button1" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="Button" />
</LinearLayout>
<TextView android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView1" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="Relative Layout with EditText and Button"
android:paddingTop="15dp" />
<RelativeLayout android:layout_width="match_parent"
android:id="@+id/relativeLayout1" android:layout_height="wrap_content">
<Button android:id="@+id/button2" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Button"
android:layout_alignParentTop="true" android:layout_alignParentRight="true" />
<EditText android:id="@+id/editText2" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_width="match_parent"
android:layout_toLeftOf="@+id/button2" android:hint="you can type here ...">
</EditText>
</RelativeLayout>
</LinearLayout>
Blog Archive
-
▼
2012
(275)
-
▼
March
(42)
- RPGLE Trigger program example - Insert, Update, De...
- Java EXCEL file upload and parsing example
- Android Activity has leaked IntentReceiver
- Java how get filename and/or extension
- iSeries adopted authority - How to run programs un...
- JavaScript generate Random number example
- Android place Button next to EditText on the same ...
- Android spinner example using ArrayAdapter and XML...
- Java add leading zeros to a number and convert to ...
- HTML5 canvas tutorial for beginners - getContext()...
- Java get current Date and Time Example
- ExtJs 4 validate HTML form fields using vtype
- HTML ToolTip tutorial - Display hover text over HT...
- Java example code to check if a number is even, od...
- ExtJs 4 Ajax Request and Response example using Ja...
- Apache commons FTPClient Java example - Download f...
- Apache commons FTPClient Java example - Send a fil...
- ExtJs syntax for document.getElementById()
- How to setup reverse proxy for Apache HTTP server ...
- ExtJs get Panel Height and Width
- ExtJs 4 Grid ToolTip delegate example for Individu...
- ExtJs 4 Grid ToolTip delegate example for Individu...
- ExtJs 4 XML Tree view example
- ExtJs 4 XML Tree view example - Part 2
- ExtJs Unsafe JavaScript attempt to access frame wi...
- bad major version at offset=6 java.lang.Unsupporte...
- java.lang.NoClassDefFoundError org/apache/commons/...
- ExtJs 4 Tree Grid example with column headers, che...
- ExtJs 4 Tree Grid example with column headers, che...
- ExtJs 4 Tree Grid example with column headers, che...
- RPGLE free format subprocedure example code - AS40...
- RPGLE free format *ENTRY parms prototype definitio...
- RPGLE free format Call program example - AS400 (iS...
- ExtJs 4 Grid display URL or hyperlink (href)
- Java log4j tutorial for beginners
- ExtJs 4 convert String to Date example
- RPGLE for loop example - AS400 (iSeries)
- Suppress Java Shell Display in AS400 RUNJVA and JA...
- AS400 RPGLE data queue tutorial - Create, Delete, ...
- Java convert stacktrace to string for logging to a...
- How to Rewrite Web application ROOT to Another Pat...
- ExtJs 4 reload node in Tree Panel and URL loading ...
-
▼
March
(42)
Android place Button next to EditText on the same line
There is always a need to have an input field and button next to each other in any type of application whether its a mobile app or a web page. Say for example an user wants to create a product inquiry or search. Here is how to do it in both Linear Layout and a Relative Layout.
Subscribe to:
Post Comments
(
Atom
)

Thanks!!! so much!!! it's what I looking for and what I want to do, but I couldn't do it until I've seen your blog.
ReplyDeleteThank you very match
ReplyDelete