Jump to content

[résolu] Problème de clavier qui cache une zone de texte


Nanis

Recommended Posts

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 by Nanis
Link to comment
Share on other sites

  • 2 weeks later...

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 ?

Link to comment
Share on other sites

  • 1 month later...
  • 10 months later...

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.

Link to comment
Share on other sites

  • 1 year later...

@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:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...