2013-07-09 13 views
15

Ich habe eine Ansicht, die den Bildschirm nicht füllt, aber wenn die Tastatur auftaucht, können Sie nicht zu den wenigen Feldern scrollen, die jetzt abgedeckt sind. Ich habe versucht, adjustSize, adjustPan im Manifest und in der Klasse hinzuzufügen. Die XML ähnelt folgenden Eintrag:Android ScrollView scrollt nicht, wenn die Tastatur hoch ist

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/s" 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent" 
    > 

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/TableLayout1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" > 

    <TableRow 
     android:id="@+id/tableRow1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 

     <!-- TextViews & EditTexts are here --> 
    </TableRow> 
     <TableRow 
     android:id="@+id/tableRow2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 

     <!-- TextViews & EditTexts are here --> 
    </TableRow> 
     <TableRow 
     android:id="@+id/tableRow3" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 

     <!-- TextViews & EditTexts are here --> 
    </TableRow> 
     <TableRow 
     android:id="@+id/tableRow4" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 

     <!-- TextViews & EditTexts are here --> 
    </TableRow> 
     <TableRow 
     android:id="@+id/tableRow5" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 

     <!-- TextViews & EditTexts are here --> 
    </TableRow> 



</TableLayout> 
</ScrollView> 

Ich brauche die editTexts und Textviews blättern zu können, durch, wenn die Tastatur

Antwort

38

Der Link erscheint, dass Flipbed die Antwort auf Ihre Lösung vorgesehen ist. Sie müssen Ihre Problemumgehung nicht implementieren, wenn Sie einfach "adjustResize" zu Ihrer Aktivität im Manifest hinzufügen. Das Problem, das Sie zuvor hatten, war, dass Sie adjustPan verwendet haben. Wenn adjustPan die Größe des Fensters nicht ändert, wird die Ansicht so geschwenkt, dass der Fokus nicht von der Soft-Tastatur verdeckt wird. Wenn Sie sich die Google-Dokumentation ansehen (siehe Link unten), wird es Sinn machen.

Beispiel:

<activity android:name="YourActivity" 
      android:windowSoftInputMode="adjustResize" /> 

http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

+0

Entschuldigung für die verzögerte Antwort. Dies hat aber den Trick gemacht. Vielen Dank. – Bilbonic

+3

Nein, hat nicht funktioniert. Das Hinzufügen verschiebt automatisch den unteren Knopf nach oben .... Ich will das nicht. Ich möchte es nur sichtbar machen, wenn ich scrolle. Nicht sobald die Tastatur geöffnet wird. – NarendraJi

+1

@kenodoggy Tut mir leid, ich versuche das aber nicht funktioniert :( –

0

hinzufügen android:windowSoftInputMode="adjustResize" zu Ihrem Tag in AndroidManifest.xml Datei. Dies führt dazu, dass die Größe des Bildschirms nach der Anzeige der Soft-Tastatur im linken Bereich geändert wird. So können Sie leicht scrollen.

Verwandte Themen