Ich versuche, eine untere Leiste auf der weichen Tastatur zu reparieren. Wie könnte das möglich sein, habe ich den folgenden Code gemacht, aber alle meine Ansicht geht nach oben, wenn der EditText fokussiert ist.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.yasser.version6.Comment">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/textsend"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
>
<EditText
android:id="@+id/commenttext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/textSendButton"
android:background="@drawable/shape"
android:ems="10"
android:imeOptions="flagNoExtractUi|actionSend"
android:inputType="textShortMessage|textMultiLine|textCapSentences"
android:minHeight="48dp"
android:minLines="1"
android:paddingBottom="12dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="12dp"
android:textSize="14sp" >
</EditText>
<ImageButton
android:id="@+id/textSendButton"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="#3D107B"
android:src="@drawable/ic_action_send" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
und wie sieht es hier aus, wenn Sie versuchen, etwas auf dem EditText einzugeben
Antworten:
1 für die Antwort № 1Entfernen Sie das lineare Layout, und bewahren Sie stattdessen alles in einem relativen Layout auf. Führen Sie alignParentTop = true für die Symbolleiste aus