虚拟键盘隐藏编辑文本,从片段设置 [英] virtual keyboard hiding edit text, setting from fragment

查看:181
本文介绍了虚拟键盘隐藏编辑文本,从片段设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么问题是类似的键盘是隐藏我的编辑文本,但有一些办法从我的布局XML文件或片段类,而从Android清单文件处理虚拟键盘设置。

Well problem is similar that Keyboard is hiding my edit text but is there some way to handle the virtual keyboard setting from my layout xml file or fragment class rather that from android manifest file.

例如:我们使用的android:windowSoftInputMode =adjustPan从清单文件。 我们可以做些什么,如果我们想将它从我的布局XML文件或从我的片段Java类文件更改。这个要求很简单,因为我需要在不同的屏幕不同的行为。上述code的d调整完成的活动。

For example: we use android:windowSoftInputMode="adjustPan" from manifest file. What can we do if we want to change it from my layout xml file or from my fragment java class file. This requirement is simply because I need different behavior on different screens. an d above code adjust complete activity.

注意:在我的应用程序的每个屏幕分为两部分,一份改变,是片段,而另一部分菜单。我不想菜单部分被打扰只有片段部分键盘出现时可以转移。我已经使用 getActivity()getWindow()setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); 从我的片段类。而结果是完全一样的活动即。

Note: In my app each screen is divided into two part with one part changing and is fragment, and other part menu. I don't want menu part to be disturbed only fragment portion can shift when keyboard appears. I have already used getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); from my fragment class. And result is same i.e. for complete activity.

请帮忙。先谢谢了。

推荐答案

我可以建议你是用adjustPan,因为它是你如何使用它,让你的整个布局呈现上行趋势,并EDITTEXT来焦点。并把你的菜单部分滚动型进入,使用户可以滚动还,当他想从你的菜单部分的任何信息。这将克服了两者你的问题。我知道这不是你想要的解决方案,这是一个解决办法。但希望这有助于。

What I can suggest you is to use "adjustPan" as it is, how you are using it, so that Your entire layout shift upwards, and editText comes to focus. And put your menu portion into scrollview, so that user can scroll that also, when he wants any info from your menu part. This Will overcome both your problem. I know this not the solution you wanted and this is a workaround. but hope this helps.

这篇关于虚拟键盘隐藏编辑文本,从片段设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆