Meine XML hängten:Android - Prevent Textview aus nach oben verschiebt, wenn auf
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_media_play" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textInput"
android:maxLines="5"
android:layout_gravity="center_horizontal|top"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:ems="15"
android:maxEms="15"
android:layout_marginTop="150dp"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="40sp"
android:id="@+id/mText"
android:gravity="center"
android:paddingStart="20dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
Die TextView
erscheint unter dem EditText
was in Ordnung ist und die TextView
ist standardmäßig leer. In meinem Code bin ich an die TextView
im Laufe der Zeit an, aber nachdem eine Zeile ausgefüllt ist, verschiebt sich die vorherige Zeile näher an die EditText
, bis sie sich überlappen.
Gibt es eine Möglichkeit für die TextView
, nur nach unten zu wachsen, wenn Text an sie angehängt wird, anstatt nach oben zu verschieben?
Um mehr klar:
EditText
first line of BlankTextView
geht an:
EditText
first line of TextView <- first line shifted up one place
second line of TextView
funktioniert perfekt, vielen Dank – DD225
Sie sind willkommen. – earthw0rmjim