问题描述
曾经浏览各种线程来解决这个问题,但我仍然很困惑.当我将"adjustPan"应用于底部具有EditText的活动时,UI会被正确向上推,但底部的键盘会稍微掩盖Edit Text.仔细检查后,我发现它模糊了编辑文本中的实际文本,以便在添加新行时可以看到完整视图.好像是在编辑文本视图底部的android标记实际上是编辑文本中文本的最后一行的底部,而不是整个容器.为此,我在底部损失了一些像素.希望对此事有任何想法!也许是某种描述的错误?一直让我发疯!
Been looking through various threads to figure this out but I'm still stumped. When I apply "adjustPan" to an activity with an EditText at the bottom, the UI is pushed up correctly but the Edit Text is slightly obscured by the keyboard at the bottom. After closer inspection I noticed it obscures just under the actual text in the edit text so that I can see the full view when I add a new line. It's as if the android mark for what is the bottom of the edit text view is actually the bottom of the last line of text in the edit text rather than the full container. To this end I'm losing a few pixels at the bottom. Would appreciate any thoughts on the matter! Is it a bug of some description perhaps? Been driving me crazy!
还要注意,不幸的是,在这种情况下,不是将所有内容都包装在scrollView中并改用AdjustResize的解决方法.
Also of note, the workaround of wrapping everything in a scrollView and using adjustResize instead is unfortunately not an option in this case.
谢谢!
推荐答案
尝试将android:windowSoftInputMode="adjustResize"
添加到AndroidManifest.xml
文件的活动部分.
Try adding android:windowSoftInputMode="adjustResize"
into the activity section of your AndroidManifest.xml
file.
<activity>
android:name=".MainActivity"
android:windowSoftInputMode="adjustResize"
</activity>
这篇关于布局底部带有EditText的AdjustPan导致SoftKeyboard稍微模糊EditText视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!