2014-08-30 38 views
0

編輯問題和SoftKeyboard。問題與編輯文字和軟鍵盤

This is screen where hello is edittext

現在如果我在EditText上單擊(你好文本)進行修改(意味着在它獲得關注底部GridView控件坡平了,看第二圖像)

enter image description here

所以如何改變這個的行爲會彈出底部視圖

任何幫助將非常感激。

在此先感謝。

+0

Deplicated看看http://stackoverflow.com/questions/17423459/android-windowsoftinputmode-adjustpan-scroll-some-more – 2014-08-30 12:01:38

+0

http://stackoverflow.com/questions/17410499/difference-between- adjustresize-and-adjust-in-android – 2014-08-30 12:02:04

+0

@NaveenTamrakar謝謝隊友,但我嘗試了兩種,但沒有爲我工作。 – 2014-08-30 12:09:37

回答

0

您可以打開對話框,在對話框中添加EditText,然後在ok按鈕上,您可以根據dialog edittext中添加的文本更改該文本。

+0

有沒有需要對話框檢查這個http://stackoverflow.com/questions/17410499 /差異之間adjustresize和調整在安卓 – 2014-08-30 12:05:21

0

android:windowSoftInputMode="adjustResize"房產可能會擠壓你的背景 改爲使用android:windowSoftInputMode="stateVisible|adjustPan"

0
View activityRootView; 

activityRootView = (LinearLayout) findViewById(R.id.root); // main layout id 


activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(
       new OnGlobalLayoutListener() { 
        @Override 
        public void onGlobalLayout() { 
         int heightDiff = activityRootView.getRootView() 
           .getHeight() - activityRootView.getHeight(); 
         if (heightDiff > 100) { 
          // if more than 100 pixels, its 

          // hide your below layout like layout1.setVisibility(View.GONE); 

         } else { 
         // visible your below layout like layout1.setVisibility(View.VISIBLE); 


         } 
        } 
       }); 
+0

它將通過此​​代碼解決明確 – DaxeshKhatri 2014-08-30 12:34:52