机器人:windowSoftInputMode =" adjustResize"当我已经有了滚动型的活动 [英] android:windowSoftInputMode="adjustResize" when i've already have ScrollView in the activity

查看:179
本文介绍了机器人:windowSoftInputMode =" adjustResize"当我已经有了滚动型的活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样一个活动的布局结构:
的LinearLayout - >滚动型 - > TableLayout

下方TableLayout我有EditText上,这是我想被向上滚动当键盘被激活。
因此,根据一些阅读我做了,我说:

 的android:windowSoftInputMode =adjustResize

要AndroidManifest.xml中,相关的活动,并且加入了滚动型包装器activity.xml文件,因此该活动的布局结构如下内容:
滚动型 - >的LinearLayout - >滚动型 - > TableLayout

问题:内滚动型现在没有工作......我想触摸时的滚动型包装正在控制...

我怎样才能解决这个问题呢?

任何帮助将AP preciated。
谢谢你。


解决方案

我面临着同样的问题,其中虚拟键盘在我的屏幕上隐藏EditTexts。
我介绍了活动标记的下列财产清单文件:

 的android:windowSoftInputMode =stateVisible | adjustResize | adjustPan

此外,我需要添加以下code在活动的OnCreate功能:

<$p$p><$c$c>this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

这解决了这个问题,它的工作完美的罚款在所有分辨率仿真器和三星的设备。它没有失败,但是,谷歌Nexus S的设备上,我可以再次看到虚拟键盘隐藏EditTexts同样的问题。

I have an activity with this Layouts structure: LinearLayout -> ScrollView -> TableLayout

Below the TableLayout i have EditText, which I want to be scrolled up when the keyboard is active. So according to some reading I've made, i added:

android:windowSoftInputMode="adjustResize"

to AndroidManifest.xml, to the relevant activity, and added a ScrollView wrapper to the activity.xml file, so the Layouts structures of the activity is now as follows: ScrollView -> LinearLayout -> ScrollView -> TableLayout

The problem: The inner ScrollView is not working now... I guess the wrapping ScrollView is taking control when touched...

How can i solve this issue?

Any help will be appreciated. Thanks.

解决方案

I was facing the same problem where the virtual keyboard was hiding EditTexts on my screen. I introduced the following property for activity tag in the manifest file:

 android:windowSoftInputMode="stateVisible|adjustResize|adjustPan"

Also I needed to add following code in the activity's OnCreate function:

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

This solved the problem and it worked perfectly fine on all resolution emulators and samsung devices. It did fail, though, on Google Nexus S device and I could see the same problem again of virtual keyboard hiding the EditTexts.

这篇关于机器人:windowSoftInputMode =&QUOT; adjustResize&QUOT;当我已经有了滚动型的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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