2013-06-05 13 views
0

我用非標準EditTextPreference但在不同的Android版本上,它看起來是不同的:鍵盤削減輸入外地小屏幕

API 7 enter image description here

API 10 enter image description here

enter image description here

哪有我看到了不錯的視角?也許調整鍵盤或其他東西?

+0

嘗試改變機器人:configChanges = 「keyboardHidden |方向|屏幕尺寸」 –

回答

0

幫我解決這個問題:

https://stackoverflow.com/a/8481314/1752613

public class MyEditTextPreference extends EditTextPreference 
{ 
    public MyEditTextPreference(Context context, AttributeSet attrs) { 
     super(context, attrs); 
    } 

    @Override 
    protected void showDialog(Bundle bundle) { 
     super.showDialog(bundle); 

     Dialog dialog = getDialog(); 
     if(dialog != null) { 
      Window window = dialog.getWindow(); 
      window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE | 
       WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); 
     } 
    } 
}