user2718771
user2718771

Reputation: 125

Android Layout of Different Android ID

I have created a LinerView in Android and add a EditText to fill it to Full screen size of Width .

Now i want to create a new Android ID say Button and more EditText Input Field, but while i create the new Android Ids it comes on same line or on same position as the EditText .

I want it should come on next line one after the another not on same line as EditTExt .What should i do to achieve this ?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context=".MainActivity" >

<Button
    android:id="@+id/button1"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />

<Button
    android:id="@+id/button3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Small Text"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<Button
    android:id="@+id/button2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" />

<EditText
    android:id="@+id/editText1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:enabled="false"
    android:gravity="center_vertical|center"
    android:inputType="none"
    android:onClick="doDis"/>

Upvotes: 1

Views: 72

Answers (3)

SHASHIDHAR MANCHUKONDA
SHASHIDHAR MANCHUKONDA

Reputation: 3322

Change your Linearlayout orientation to "vertical"

Upvotes: 1

gian1200
gian1200

Reputation: 3854

Change your android:orientation="horizontal" with android:orientation="vertical"

Upvotes: 0

telkins
telkins

Reputation: 10540

Your LinearLayout is set to horizontal orientation. Try setting it to vertical so that it will stack them on top of each other.

android:orientation="vertical"

Upvotes: 0

Related Questions