Mon problème: à partir du deuxième affichage du clavier logiciel sur l'écran, il masque entièrement mon EditText.Le réglage Android ne fonctionne pas après la première fois
Attribut android: windowSoftInputMode = "adjustPan" a été spécifié dans le fichier AndroidManifest.xml, mais cela ne fonctionne que la première fois.
J'ai la disposition suivante:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="464dp"
android:gravity="top"
android:orientation="vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp" >
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:background="#E3E3E2"
android:gravity="top" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="@+id/addListText"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="10"
android:contentDescription="@string/addItemContentDescription"
android:gravity="bottom|center_horizontal"
android:inputType="textLongMessage"
android:textColor="#E3E3E2"
android:visibility="gone" />
<ImageButton
android:id="@+id/addTextListButton"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity="right"
android:background="@android:color/transparent"
android:contentDescription="@string/addItemButton"
android:scaleType="fitCenter"
android:src="@drawable/plus_add"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:gravity="bottom|center_horizontal"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp" >
<ImageButton
android:id="@+id/syncListsButton"
android:layout_width="64dp"
android:layout_height="match_parent"
android:src="@android:drawable/ic_popup_sync" />
<ImageButton
android:id="@+id/showOrHide"
android:layout_width="64dp"
android:layout_height="match_parent" />
<ImageButton
android:id="@+id/delListButton"
android:layout_width="64dp"
android:layout_height="match_parent"
android:src="@android:drawable/ic_menu_delete" />
</LinearLayout>
</LinearLayout>
Le bouton "showOrHide" afficher/masquer le combo "addListText"/"addTextListButton". Lorsque le texte EditText est affiché pour la première fois et que je le touche, le clavier virtuel apparaît à l'écran et le combo "addListText"/"addTextListButton" est correctement positionné. Quand je cache le clavier et que je le montre à nouveau, le clavier couvre complètement ma boîte d'édition addListText!
Une idée sur ce qui se passe? Je le test sur Android 4.2.2.
Aidez s'il vous plaît! Merci :-)
edit: J'ai aussi essayé de mettre le premier LinearLayout dans un ScrollView mais ça ne marche pas!
merci, cela a fonctionné pour moi! – bilbo20
Quel truc! – MKJParekh
tnx .. @ MKJParekh –