Make Android Linear Layout Vertical expand as I type in the edittext inside -
i have eddittext inside linear layout @ bottom of screen, bit whatsapp write messages. can add new lines in edit linear layout stays same, linear layout expand enter more lines. have listview above linear layout
here layout xml:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".chatactivity" android:background="#ffffff"> <listview android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/linlay" android:divider="@android:color/transparent" android:dividerheight="0dp"/> <linearlayout android:orientation="horizontal" android:id="linlay" android:layout_width="match_parent" android:layout_height="match_parent"> <edittext android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/et_message" android:hint="enter message" /> //i want lin layout expand edit expands vertically
</linearlayout> <com.gc.materialdesign.views.buttonfloat android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btn_send" android:layout_aligntop="@+id/chatmessageview" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_marginright="5dp" app:icondrawable="@drawable/ic_action_send_now" android:background="@color/chatblue10" /> </relativelayout>
you can use minheight,
<linearlayout android:layout_alignparentbottom="true" android:id="@+id/layout_message" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true"> <edittext android:id="@+id/textbody" android:layout_width="0dp" android:layout_weight="1" android:minheight="48dp" android:hint="@string/send_text" android:maxlines="5" android:textsize="16sp" android:layout_height="wrap_content"/> <imageview .... .... else can show xml unsterdand more probleme
Comments
Post a Comment