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>
Add android:gravity="top"
attribute to your EditText
.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With