gpt4 book ai didi

android - 为什么 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);在横向模式下不起作用?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:46:04 27 4
gpt4 key购买 nike

我在主 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 在横向模式下的行为与在纵向模式下的行为相同?

最佳答案

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

希望对您有所帮助!!

道格

关于android - 为什么 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);在横向模式下不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5351114/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com