2016-08-25 3 views
0

so ist es ein häufiges Problem, ich denke, das ist, warum ich so viele ähnliche Probleme wie this, this und ich folgte auch Googles Android-Entwickler article, die zu meinem Problem verwandt ist. aber nichts für mich gearbeitet, ich will meine Taste nach oben (die am unteren Rand des Bildschirms ist), wenn Tastatur erscheint
meine Aktivistin Xml:UI-Komponenten werden nicht bewegt, wenn die Tastatur erscheint (ANDROID)

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/bgfl" 
android:windowSoftInputMode="stateVisible|adjustResize"> // i tried to set the windowSoftInputMode right here 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#9bef414c"> 

<EditText 
    android:layout_width="wrap_content" 
    android:layout_height="40dp" 
    android:inputType="textEmailAddress" 
    android:ems="10" 
    android:id="@+id/editText" 
    android:layout_centerVertical="true" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentEnd="true" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    android:background="#ffffff" 
    android:hint="Email" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceSmall" 
    android:text="bla bla bla bla bla" 
    android:id="@+id/textView6" 
    android:layout_above="@+id/editText" 
    android:layout_centerHorizontal="true" 
    android:layout_marginBottom="40dp" 
    android:textSize="17sp" 
    android:textColor="@color/light_font" 
    android:shadowColor="@color/text_shadow" 
    android:shadowDx="1" 
    android:shadowDy="1" 
    android:shadowRadius="8"/> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="BLAAAAAAAAAAAAA" 
    android:id="@+id/textView9" 
    android:layout_above="@+id/textView6" 
    android:layout_centerHorizontal="true" 
    android:textAlignment="center" 
    android:textIsSelectable="false" 
    android:textSize="60sp" 
    android:textColor="@color/light_font" 
    android:shadowColor="@color/text_shadow" 
    android:shadowDx="1" 
    android:shadowDy="1" 
    android:shadowRadius="8"/> 

    <Button 
     android:layout_width="match_parent" 
     android:layout_height="50dp" 
     android:text="Next" 
     android:id="@+id/button" 
     android:layout_alignParentBottom="true" 
     android:layout_centerHorizontal="true" 
     android:textSize="20sp" 
     android:background="#ffffff" 
     android:textColor="@color/colorAccent" /> 

</RelativeLayout> 

Ich habe auch versucht, es zu tun programmatisch in der Klasse meiner Tätigkeit suchen:

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); 

die oben hat auch nicht funktioniert

i auch tat dies in meinem Manifest:

<myActivity 
android:windowSoftInputMode="stateVisible|adjustResize"> 

es hat nicht funktioniert auch.

scheint, als würde ich vermissen, was jemand mir darauf hinweisen kann ??

+0

Keyboard Popup, wenn Sie auf Ihrer Texteingabe klicken, so dass die Texteingabe bewegt aufrecht? Welchen Sinn macht es, den gesamten Bildschirm über die Tastatur zu bringen? Bitte erklären Sie – Veer3383

Antwort

1
<activity 
     android:name=".activity.SignUpProfileDetailActivity" 
     android:configChanges="orientation|keyboardHidden|screenSize|screenLayout" 
     android:screenOrientation="portrait" 
     android:windowSoftInputMode="adjustResize|stateAlwaysHidden"/> 

Und in Ihren Eltern Viewgroup diese Erweiterung,

 <RelativeLayout 
      android:id="@+id/relativelayout_root" 
      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" 
      android:fitsSystemWindows="true"> 
+0

hey vielen Dank, es funktioniert jetzt gut, ich schätze Sie. –

1

android:fitsSystemWindows="true" in Manifest-Datei mit Aktivitäts-Tag hinzufügen

+0

Hey Mann danke für die Antwort, aber ich arbeitete nicht –

Verwandte Themen