Je sais que cette question a été posée plusieurs fois. J'ai lu la majorité d'entre eux et je n'ai toujours pas trouvé de solution. Ce que je cherche est un moyen de supprimer entièrement la boîte à suggestions du clavier logiciel. Lorsque le champ de mot de passe est sélectionné, tout semble parfait, mais si c'est le champ Email qui est sélectionné, la boîte de suggestions apparaît toujours et je ne peux pas l'arrêter. Image highlighting the exact area I'm talking aboutSuppression du clavier logiciel de la boîte à suggestions
La raison pour laquelle je veux l'enlever est parce qu'il déplace la taille de ma vue depuis que j'ai android: windowSoftInputMode = "adjustResize" inclus avec le manifeste. Je voulais le faire sur mon écran de connexion pour supprimer le besoin d'un ScrollView et pour que tout soit placé dans un endroit facile à trouver lorsque le clavier logiciel est activé. Tout fonctionne parfaitement sauf lorsque le champ email devient actif et affiche la boîte à suggestions. Ensuite, lorsque vous passez au champ de mot de passe tout est à nouveau déplacé.
Toute aide serait grandement appréciée.
activity_emailpassword.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/gradient_background"
tools:context=".activity.auth.EmailPasswordActivity" >
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/login_logo" />
<LinearLayout
android:id="@+id/LoginBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:orientation="vertical">
<EditText
android:id="@+id/email_field"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:privateImeOptions="nm"
android:inputType="textNoSuggestions|textWebEmailAddress"
android:hint="Email ID" />
<EditText
android:id="@+id/password_field"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:hint="Password"
android:inputType="textPassword" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="bottom">
<Button
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/colorPrimaryLight"
android:layout_marginBottom="50dp"
android:text="Login" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Create Account"
android:gravity="bottom"
android:textColor="@color/colorPrimaryLight"
android:layout_margin="16dp"
android:textSize="16sp"
android:background="@null"
android:id="@+id/create_account_button" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/forgot_password_button"
android:layout_alignBaseline="@+id/create_account_button"
android:layout_alignBottom="@+id/create_account_button"
android:background="@null"
android:layout_alignParentEnd="true"
android:layout_gravity="right"
android:layout_marginEnd="13dp"
android:gravity="center"
android:text="Forgot Password?"
android:textColor="@color/colorPrimaryLight"
android:textSize="16sp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
Pouvez-vous poster le XML pour votre mise en page? Si vous avez généré automatiquement la mise en page, il se peut qu'il y ait du code de saisie semi-automatique. Enfin, utilisez-vous un clavier personnalisé? –
'android: inputType =" textNoSuggestions "' ajouter ceci au champ de courrier électronique –
@NileshDeokar J'ai ajouté android: inputType = "textNoSuggestions" au champ d'email mais cela n'a pas semblé fonctionner. J'apprécie la réponse cependant. – mlewis27