Reputation: 6188
I have the following xml for an edittext and button which take the whole screen. The only problem is I can't find a way to make the typed text in the edittext to be put at the top. Right now it's put in the centre of the editText.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="@drawable/herinnering_background"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText
android:id="@+id/invoerTekst"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:hint="@string/prompt_tekst" />
<Button
android:id="@+id/klaar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="@string/action_sla_op"
android:background="@drawable/main_button_over"
android:textColor="#ffffff"
android:layout_margin="5dip"
android:layout_below="@id/invoerTekst" />
</LinearLayout>
Upvotes: 11
Views: 18541
Reputation: 467
Use this, It will help you.
EditText
android:id="@+id/invoerTekst"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="top"
android:hint="@string/prompt_tekst"
Upvotes: 4