I'm working on a simple HelloWorld app to get a hold of things. The app has a simple nested linear layout of a TextView that fills up most of the layout over an EditText and Send button. Whenever text is entered and "send" clicked, it adds the text to the TextView as a new line. Everything else works fine so far, but whenever the keyboard pops up to start entering text, the above TextView is pushed up as well. I would like the TextView to stay in position, and just resize in the layout.
Image 1: http://ift.tt/1vwKAoL Image 2: http://ift.tt/1vwKAoO
Thanks, pbcrazy
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView android:id="@+id/display_message"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:freezesText="true" />
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send"
android:onClick="sendMessage" />
</LinearLayout>
</LinearLayout>
No comments:
Post a Comment