The question is: I have a TextView and an EditText, how can I place them on the same “level”?
http://postimage.org/image/o9l17a3zv/
As you can see, I want to put “Username” on the same level of the EditText…
Here my code:
<TextView
android:id="@+id/account_creation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/account_creation"
android:textSize="20sp"
android:textStyle="bold" />
<!-- Username -->
<TextView
android:id="@+id/username_registration"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/account_creation"
android:layout_toLeftOf="@+id/username_new_account"
android:text="@string/user_text"
android:textSize="15sp" />
<EditText
android:id="@+id/username_new_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/account_creation"
android:layout_alignParentRight="true"
android:ems="10"
android:hint="@string/user_editext" >
<requestFocus />
</EditText>
I was thinking to put the same value of “height” on both of them, but i don’t know if it’s the right/better way…
TEXT VIEW AND EDIT TEXT ARE ON THE SAME LINE TOUCHING THE BOTTOM LINE OF PARENT LAYOUT
Try this one.
This will surely help you.
Thanks.