LinearLayout on android



I was trying to create a sign up form for my Android application


This is my XML code



<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="horizontal" >

<TextView
android:id="@+id/mynumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Number +961"
android:textSize="20sp"
android:color="@android:color/white" />

<EditText
android:id="@+id/editTextNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Number"
android:textColor="#FFFFFF" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical" >

<Button
android:id="@+id/buttonCreateAccount"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="60dp"
android:background="@drawable/ic_create" />
</LinearLayout>
</LinearLayout>


If you notice the first LinearLayout has a horizontal orientation and gravity (I want both the textview and edit text to be next to each others)


After the first linear layout i want the create account button to come out


However it is showing up on the same line with the previous edit text and text view


Any idea if i should change in the settings of the second linear layout


No comments:

Post a Comment