2012-01-25 29 views
14

मेरे पास संपादन टेक्स्ट फ़ील्ड के समूह के साथ एक गतिविधि है, और windowSoftInputMode समायोजित करने के लिए सेट है, यह ज्यादातर जो मैं चाहता हूं, हालांकि संपादन के लिए संपादन टेक्स्ट के नीचे लेआउट, यह पर्याप्त पैन नहीं है। यह एक मल्टीलाइन संपादन टेक्स्ट की शीर्ष पंक्ति दिखाने के लिए पैन करेगा, लेकिन जैसे ही आप एंटर दबाते हैं, कर्सर एक रेखा नीचे चला जाता है और अब कीबोर्ड के नीचे छिपा हुआ है।windowSoftInputMode = "adjustPan" पैन को और अधिक बनाने के लिए कैसे करें

क्या वैसे भी मैं इसे आगे पैन कर सकता हूं ताकि संपादन टेक्स्ट का शीर्ष खिड़की के शीर्ष पर सभी तरह से हो।

समायोजन का उपयोग करना निश्चित रूप से वह नहीं करेगा जो मैं चाहता हूं, पैन सही बात है, इसे आगे पैन करने की आवश्यकता है।

+0

अपने स्क्रीन शॉट को पोस्ट करें ताकि समस्या को कम करने के लिए यह आसान हो – Lokesh

उत्तर

6

वही बात मेरे साथ हुई थी।

मैंने हल करने के लिए क्या किया है, मैंने बस स्क्रॉलल व्यू में सभी नियंत्रण डाले हैं।

और सेट एंड्रॉइड: windowSoftInputMode समायोजन समायोजित करें। तो जब भी कीबोर्ड खुलता है तो यह दृश्य को समायोजित करने के लिए स्क्रीन को स्क्रॉल करेगा और Edittext हमेशा स्क्रीन पर दिखाएगा।

आशा है कि यह विचार आपके लिए काम करेगा।

धन्यवाद

+0

+1, आप सही हैं, मैंने वही काम किया है। –

+0

"स्क्रॉलव्यू में सभी नियंत्रण डालें" से आपका क्या मतलब है? –

0

मेरे पास स्क्रीन के निचले हिस्से में संपादन है जब मैंने इसे सॉफ्टकीबोर्ड खोल दिया लेकिन यह संपादन को छुपाता है, इसलिए लेआउट में बदलाव करें (सापेक्ष लेआउट का उपयोग करें) और यह adjustPan का उपयोग किए बिना मेरे लिए काम करता है। यह मेरा एक्सएमएल है।

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/gen_mainlayout" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/bg" 
    android:orientation="vertical" > 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" > 

     <RelativeLayout 
      android:id="@+id/headerlinearLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:background="@drawable/navigation_bar" > 

      <Button 
       android:id="@+id/chatterBack" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentLeft="true" 
       android:layout_centerVertical="true" 
       android:layout_marginLeft="20dp" 
       android:background="@drawable/navigation_cancel_button" 
       android:textColor="#FFFFFF" > 
      </Button> 

      <TextView 
       android:id="@+id/ittletextView" 
       style="@style/titleText" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:text="Title" > 
      </TextView> 

      <Button 
       android:id="@+id/blockhide" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_centerVertical="true" 
       android:layout_marginRight="20dp" 
       android:background="@drawable/navigation_cancel_button" 
       android:padding="5dp" 
       android:text="Block/Hide" 
       android:textColor="#FFFFFF" > 
      </Button> 
     </RelativeLayout> 

     <LinearLayout 
      android:id="@+id/middlelinearLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/headerlinearLayout" 
      android:orientation="vertical" > 

     </LinearLayout> 


     <LinearLayout 
      android:id="@+id/footerlinearLayout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:background="@drawable/commnet_post_bg" 
      android:gravity="center" 
      android:paddingLeft="5dp" 
      android:paddingRight="5dp" > 


      <EditText 
       android:id="@+id/sendeditText" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginRight="5dp" 
       android:layout_weight="1" 
       android:background="@drawable/comment_post_text_box" 
       android:imeOptions="actionSend|flagNoEnterAction" 
       android:inputType="text" 
       android:paddingLeft="10dp" 
       android:paddingRight="5dp" 
       android:singleLine="true" > 
      </EditText> 

      <Button 
       android:id="@+id/sendButton" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:background="@drawable/send_button" 
       android:text="Send" 
       android:textColor="#FFFFFF" > 
      </Button> 
     </LinearLayout> 
    </RelativeLayout> 

</LinearLayout> 
-1

आपको स्क्रीन को समायोजित करने के लिए अपनी गतिविधि में इस पंक्ति को जोड़ने की आवश्यकता है।

 <activity android:name=".TodoEdit" 
     android:windowSoftInputMode="adjustResize"> 
+0

जैसा कि मैंने प्रश्न समायोजन में कहा है, यह नहीं करता है। – superfell

1

की scrollview अंदर रखो अपने EditText और फिर संपत्ति adjustResize देते हैं, बजाय adjustPan, तो वह आपकी स्क्रीन और उसके घटकों को समायोजित करेगा।