Nanis Posted March 16, 2010 Share Posted March 16, 2010 (edited) Bonjour, j'ai un petit soucis qui doit être tout bête mais je ne trouve pas la solution. J'ai, dans un écran, une zone de texte qui se retrouve derrière le clavier virtuel lorsque je clic dessus. Il y a t'il un paramètre pour que le clavier lorsqu'il s'ouvre décale toute la vue ? voici mon fichier xml : <?xml version="1.0" encoding="UTF-8"?> android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> android:layout_width="wrap_content" android:background="@drawable/background_panel_haut" android:layout_height="wrap_content"> android:id="@+id/btnCancel" android:layout_height="wrap_content" android:layout_width="75dip" android:layout_centerVertical="true" android:background="@drawable/custom_button" android:textColor="@color/white" android:layout_marginLeft="5dip"/> android:id="@+id/btnSend" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_width="75dip" android:layout_centerVertical="true" android:background="@drawable/custom_button" android:textColor="@color/white" android:layout_marginRight="5dip"/> android:layout_width="wrap_content" android:layout_marginTop="10dip" android:layout_marginLeft="10dip" android:layout_marginRight="5dip" android:layout_height="wrap_content"> android:layout_width="fill_parent" android:layout_height="wrap_content"> android:layout_height="wrap_content" android:text="@string/Subject" android:maxLines="1" android:layout_alignParentLeft="true" android:layout_width="0dip" android:layout_weight="1" android:layout_gravity="center_vertical"/> android:id="@+id/champsSubject" android:layout_height="wrap_content" android:layout_width="0dip" android:layout_weight="4" android:maxLines="1" android:singleLine="true"/> android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="50dip"> android:layout_height="wrap_content" android:text="@string/From" android:layout_width="0dip" android:layout_weight="1" android:layout_gravity="center_vertical"/> android:id="@+id/champsFrom" android:layout_alignParentRight="true" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="4" android:prompt="@string/From" style="@color/white"/> android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="100dip"> android:layout_height="wrap_content" android:text="@string/To" android:layout_alignParentLeft="true" android:layout_width="0dip" android:layout_weight="1" android:layout_gravity="center_vertical"/> android:id="@+id/btnWhoDisplay" android:layout_height="wrap_content" android:layout_width="0dip" android:layout_weight="1" android:background="@drawable/custom_button" android:src="@drawable/who_picture_one" android:layout_marginRight="2dip" android:layout_marginTop="2dip"/> android:id="@+id/champsTo" android:layout_alignParentRight="true" android:layout_width="0dip" android:layout_height="wrap_content" android:maxLines="1" android:layout_weight="7" android:singleLine="true" android:scrollHorizontally="true"/> android:layout_width="fill_parent" android:layout_marginTop="150dip" android:layout_alignParentTop="true" android:layout_height="wrap_content"> android:id="@+id/champsBody" android:layout_width="fill_parent" android:layout_height="fill_parent" android:isScrollContainer="true" android:minLines="7" android:keepScreenOn="true"/> android:layout_width="fill_parent" android:layout_gravity="bottom|left" android:layout_height="wrap_content"> android:id="@+id/tvAttachFile" android:minHeight="40dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="@color/white" android:layout_alignParentBottom="true" android:background="@drawable/background_panel_bas" android:gravity="center_vertical|center_horizontal" android:clickable="true"/> la zone concernée est l'EditText . De plus je ne comprend pas pourquoi mais elle me centre le texte par défault :/ Edited May 3, 2010 by Nanis Quote Link to comment Share on other sites More sharing options...
Nanis Posted March 17, 2010 Author Share Posted March 17, 2010 personnes ? Quote Link to comment Share on other sites More sharing options...
Profete162 Posted March 17, 2010 Share Posted March 17, 2010 Pour ma part, je suis le sujet en attendant une réponse, c'est un problème que j'éprouve aussi... Quote Link to comment Share on other sites More sharing options...
Antares Posted March 18, 2010 Share Posted March 18, 2010 Je répond vite fait, je ne suis plus trop sûr, mais je crois que android:isScrollContainer="true" résoud le problème. à tester... ;) Quote Link to comment Share on other sites More sharing options...
Nanis Posted March 18, 2010 Author Share Posted March 18, 2010 malheureusement non Quote Link to comment Share on other sites More sharing options...
Antares Posted March 26, 2010 Share Posted March 26, 2010 Tu as essayé de tout mettre dans une scrollview ? Tu rajoutes une scrollview qui englobe ton premier LinearLayout. Quote Link to comment Share on other sites More sharing options...
Nanis Posted March 29, 2010 Author Share Posted March 29, 2010 Bonjour, il paraitrai que cela viendrai du fait que j'ai des relativeLayout dans mon xml. Je n'ai pas réussi à tous faire ce que je voulais en LinearLayout c'set pour cela que j'avais mis relativeLayout. Est ce que tu es d'accord avec ça aussi ? Quote Link to comment Share on other sites More sharing options...
neddnna Posted April 30, 2010 Share Posted April 30, 2010 Salut, tu dois ajouter une option au niveau de ton activity dans le manifest. Essaye ces deux options : -android:windowSoftInputMode="stateVisible|adjustResize" ou bien ça: -android:windowSoftInputMode="adjustPan" Quote Link to comment Share on other sites More sharing options...
Nanis Posted May 3, 2010 Author Share Posted May 3, 2010 nikel, merci :) Quote Link to comment Share on other sites More sharing options...
Kerwan Posted March 11, 2011 Share Posted March 11, 2011 Marche bien en mode portrait, mais pas en mode paysage :( Je souhaiterai faire exactement la même chose, mais en mode paysage. Avec cette option : setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI j'ai désactivé l'affichage spécial de l’édition de texte en mode paysage pour le mettre comme en mode portrait (c'est à dire que le clavier se rajoute à l'écran au lieu de lancer une interface juste pour éditer le texte). Le problème, c'est que le texte ne se redimensionne pas en mode paysage (en mode portrait, aucun problème). Quelqu'un a une idée? Merci d'avance. Quote Link to comment Share on other sites More sharing options...
edem Posted March 17, 2012 Share Posted March 17, 2012 @Kerwan à tu trouvé la solution? j'aimerais aussi pouvoir avoir le même systeme de saisie qu'en mode portrait :mellow: je trouve pas pratique du tout, le faite de perdre la conversation en mode paysage au detriment d'une grande zone de texte :( . j'étais sur android avec clavier azerty physique(milestone 1 puis 2) ainsi que sur iphone et dans les 2 cas je gardais un oeil à ma conversation en mode paysage. ce que je n'ai plus depuis mon galaxy s2 :huh: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.