2017-05-24 3 views
3

[Dies ist das Bild, das ich nur nach oben editieren muss nicht das Logo] [1] edittext erscheint auf der Oberseite der Tastatur nach dem Festlegen von windowSoftInputMode, aber anderen Ansichten auch nach oben. sie ist jede mögliche Weiseedittext muss oben auf der Tastatur nach oben verschoben werden, ohne andere Ansichten zu verschieben

[1] nur EditText .Thanks im Voraus zu bewegen: https://i.stack.imgur.com/NEpf3.png `

<ScrollView 
    android:id="@+id/scroll" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_alignParentStart="true" 
    android:layout_alignParentTop="true" 
    android:orientation="vertical"> 

    <LinearLayout 
     android:id="@+id/linear" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:layout_marginTop="50dp" 
      android:src="@drawable/logo_light" 
      android:text="LOGO" 
      android:textColor="@color/black" 
      android:textSize="100dp" /> 
    </LinearLayout> 
</ScrollView> 

<LinearLayout 
    android:id="@+id/ll_send_message" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_marginBottom="50dp" 
    android:orientation="horizontal"> 

    <EditText 
     android:id="@+id/editMessage" 
     android:layout_width="0dp" 
     android:layout_height="fill_parent" 
     android:layout_gravity="center_vertical|center_horizontal" 
     android:layout_weight="5" 
     android:background="@color/white" 
     android:gravity="center" 
     android:inputType="textMultiLine|textCapSentences" 
     android:maxLines="5" 
     android:hint="EDIT TEXT" 
     android:minLines="3" 
     android:textColorHint="@color/black" 
     android:scrollHorizontally="false" 
     android:textColor="@color/white" /> 

    <Button 
     android:id="@+id/buttonSend" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_vertical|center_horizontal" 
     android:background="@color/black" 
     android:gravity="center" 
     android:text="send" 
     android:textAppearance="?android:attr/textAppearanceMedium" /> 
</LinearLayout> 

`

+1

Ihr Layout und Layout-Screenshot –

+0

hallo @ singh.indolia bieten i Bild angehängt überprüfen Sie es bitte –

+0

auch Ihre xml bieten Code. –

Antwort

1

Versuchen wie framlayout und xml verwenden unter

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" >  

      <EditText 
       android:id="@+id/edit_text_message" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_gravity="bottom|center_vertical" 
       android:layout_marginLeft="12dp" 
       android:background="@null"  
       android:layout_alignParentBottom="true" 
       android:hint="Enter you something" 
       android:inputType="textCapSentences|textMultiLine" 
       android:maxLength="2000" 
       android:maxLines="8" /> 
</FrameLayout> 
+0

Dies ist nur Edittext bei botomm gesetzt, aber es bewegt sich nicht, wenn Tastatur erscheint –

+0

Ich habe getestet, es funktioniert fein. – ashish

+0

Ihre Antwort ist für mehrzeiligen Text bearbeiten, aber meine Frage ist anders .. Bitte überprüfen Sie das Bild, das ich hochgeladen –

0

Wenn Ihr relatives Layout verwenden, das in dem Bearbeiten von Text-Tag hinzufügen.

android:layout_alignParentBottom="true"

+0

es ist nur Allign Ansicht unten ... aber ich brauche, wenn Tastatur erscheinen die Top-Ansichten müssen nicht nach oben bewegen nur Edittext kann verschieben –

Verwandte Themen