bin neu zu diesem und ziemlich neu für Android-Programmierung.WhatsApp-like Layout für mehrzeilige EditText und Tasten daneben
Ich versuche, ein Layout wie in der WhatsApp Chat-Aktivität zu machen. Was ich also erreichen möchte, ist das gleiche Layout und Verhalten wie beim EditText und den daneben liegenden Buttons. Dies bedeutet einen linken Button für Smileys und EditText in der Mitte und einen Button rechts daneben zum Versenden des Textes.
In WhatsApp, wenn der EditText seine Größe (mehrzeilig) erweitert, bleiben die Schaltflächen am unteren Rand. Aber es scheint nicht die Unterseite der Elternansicht zu sein, da die Buttons vorher auf den EditText zentriert wurden.
Ich habe viel versucht, die drei Ansichten in eine TableLayout-Reihe zu setzen. Oder einfach ein RelativeLayout verwenden. Aber nichts davon funktioniert richtig.
Kann mir jemand zeigen, wie man das erreicht? Ich kann mein XML aber .... gut ... es ist offensichtlich ziemlich schlecht: D
Vielen Dank im Voraus!
<RelativeLayout
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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin">
<ListView
android:id="@+id/messages"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_above="@+id/footer_section">
</ListView>
<LinearLayout
android:id="@+id/footer_section"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:minHeight="48dp">
<ImageView
android:id="@+id/emoticons_button"
android:layout_height="match_parent"
android:layout_width="48dp"
/>
<EditText
android:id="@+id/message_text"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_weight="1"
android:inputType="textMultiLine"
android:minLines="1"
android:maxLines="4"/>
<ImageView
android:id="@+id/send_button"
android:layout_height="match_parent"
android:layout_width="48dp"
android:layout_gravity="center_vertical"/>
</LinearLayout>
Bitte geben Sie Ihre xml –