【问题标题】:Why getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); doesn't work in landscape mode?为什么 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);在横向模式下不起作用?
【发布时间】:2011-07-18 02:11:29
【问题描述】:

我的 Main Activity 的 onCreate 中有以下代码:

 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

我的 layout-land/main.xml 中有以下代码

<EditText android:imeOptions="flagNoExtractUi</EditText>

为什么 softinput 叠加在 UI 之上,但在横向模式下不改变其大小?
如何使带有软输入的 UI 在横向模式下的行为与纵向模式下的行为相同?

【问题讨论】:

    标签: android input resize landscape


    【解决方案1】:

    Hey Divers,这可能是因为您在 manifest.xml 中的 IME 选项声明中缺少右引号。

    希望对你有帮助!!

    道格

    【讨论】:

    • 抱歉刚刚开始实际使用这个网站,我总是尽可能多地回答未回答的问题,他们可能应该在三年后删除一个问题......无论如何抱歉没有早点
    猜你喜欢
    • 1970-01-01
    • 2023-03-11
    • 2021-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-06
    • 1970-01-01
    相关资源
    最近更新 更多