Android Text UI Special

I am creating a client / server IM application for Android OS and am currently building a user interface. Right now my interface consists of an element EditTextand an element Button. When I click on an item EditText, a keyboard appears and you can enter.

What I would like to have is something like the text input area and the submit button in the default Android app. Something like this: enter image description here The text input field and the Submit button will remain at the bottom of the screen, and when you click on the keyboard, the text field and the button above it will be pressed.

Is it possible to use only elements EditTextand Button?

Thanks for any suggestions or tips!

0
2

android:windowSoftInputMode=adjustResize AndroidManifest.xml.

.

+3

EditText Button?

.

, linearlayout xml . , Relative layout . , .

android: , , , . ...

  • id android: id = "@+ id/GiveName"
  • , android: layout_toLeftOf = "@id/givenname"
    , , = id , .

    Ex.

    xml ,

  <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/llWriteCommentWall" android:layout_height="fill_parent"
      android:layout_width="fill_parent" android:background="#ffffff">
      <Button android:id="@+id/btButtonComments"
        android:layout_height="wrap_content"     
        android:layout_width="wrap_content"        
        android:text="Comments" 
        android:layout_alignParentRight="true"  
        android:layout_alignParentBottom="true"/>
      <EditText android:id="@+id/etEdittext"
        android:layout_height="wrap_content" android:layout_width="fill_parent"
        android:hint="Write a comment....   "
        android:layout_marginLeft="2dip" android:layout_marginRight="2dip" 
        android:layout_toLeftOf="@id/btButtonComments" 
        android:layout_alignParentBottom="true"/>
    </RelativeLayout>

ScreenShot

At simple modeAt click on edittext

android: layout_alignParentBottom = "true" - , , .it , true .

- android: layout_alignParentRight = "true", android: layout_alignParentLeft = "true", android: layout_alignParentTop = "true" -all .

, XML java setContentView (xmlFileName)

+1

All Articles