在小分辨率时, 弹出输入法会显示全屏,
要使输入法不全屏, 要么给EditText添加一属性:
如:
packages/apps/Browser/res/layout/title_bar_nav.xml <com.android.browser.UrlInputView android:id="@+id/url" android:focusable="true" android:layout_width="0dip" android:layout_weight="1.0" android:layout_height="match_parent" android:fadingEdge="horizontal" android:fadingEdgeLength="24dip" android:textAppearance="?android:attr/textAppearanceMedium" android:hint="@string/search_hint" android:singleLine="true" android:ellipsize="end" android:lines="1" android:scrollHorizontally="true" android:inputType="textUri" android:imeOptions="actionGo|flagNoExtractUi|flagNoFullscreen" style="@style/Suggestions" android:background="@null" />
android:imeOptions中的值起了关键作用,
flagNoExtractUi
第二种做法比较暴力, 不建议.
make not show extractUI when show inputmethod: --- a/frameworks/base/core/java/android/inputmethodservice/InputMethodService.java +++ b/frameworks/base/core/java/android/inputmethodservice/InputMethodService.java @@ -2182,7 +2182,7 @@ public class InputMethodService extends AbstractInputMethodService { return; } - setExtractViewShown(true); + setExtractViewShown(false && true);//AnsonCode 2013.12.11 } /** CODE: public void onUpdateExtractingVisibility(EditorInfo ei) { if (ei.inputType == InputType.TYPE_NULL || (ei.imeOptions&EditorInfo.IME_FLAG_NO_EXTRACT_UI) != 0) { // No reason to show extract UI! setExtractViewShown(false); return; } setExtractViewShown(false && true);//AnsonCode 2013.12.11 }