2014-08-30 36 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