- 浏览: 344856 次
- 性别:
- 来自: 南京
文章分类
最新评论
-
2006003845:
ghlimbrother 写道用这种方法怎么把so文件打包进去 ...
原:Android 命令行手动编译打包详解 -
2006003845:
你好 请问下 如果项目中 libs/ 有jar 包 有.s ...
原:Android 命令行手动编译打包详解 -
shiyanshiguize:
楼主在吗?我在执行第一步:使用aapt生成R.java类文件: ...
原:Android 命令行手动编译打包详解 -
IWSo:
测试代码写什么方法里?
原:Android 获取屏幕高度、标题高度、状态栏高度详解 -
a13525177343:
楼主今天查看build.xml的作用的时候,看见你的博文的,我 ...
原:Android 命令行手动编译打包详解
bug:
全屏状态下 adjustResize 不响应 只能用adjustpan,且webview 全屏状态下 adjustpan响应也不够好 有时无响应。
http://code.google.com/p/android/issues/detail?id=5497
在AndroidManifest.xml文件中的android:windowSoftInputMode属性使用
The AndroidManifest.xml File
<activity android:windowSoftInputMode=["stateUnspecified",
"stateUnchanged", "stateHidden",
"stateAlwaysHidden", "stateVisible",
"stateAlwaysVisible", "adjustUnspecified",
"adjustResize", "adjustPan"] …… >
</activity>
attributes:
android:windowSoftInputMode
活动的主窗口如何与包含屏幕上的软键盘窗口交互。这个属性的设置将会影响两件事情:
1> 软键盘的状态——是否它是隐藏或显示——当活动(Activity)成为用户关注的焦点。
2> 活动的主窗口调整——是否减少活动主窗口大小以便腾出空间放软键盘或是否当活动窗口的部分被软键盘覆盖时它的内容的当前焦点是可见的。
它的设置必须是下面列表中的一个值,或一个”state…”值加一个”adjust…”值的组合。在任一组设置多个值——多个”state…”values,例如&mdash有未定义的结果。各个值之间用|分开。例如: <activity android:windowSoftInputMode="stateVisible|adjustResize" . . . >
在这设置的值(除"stateUnspecified"和"adjustUnspecified"以外)将覆盖在主题中设置的值
值 描述
"stateUnspecified"
软键盘的状态(是否它是隐藏或可见)没有被指定。系统将选择一个合适的状态或依赖于主题的设置。这个是为了软件盘行为默认的设置。
"stateUnchanged"
软键盘被保持无论它上次是什么状态,是否可见或隐藏,当主窗口出现在前面时。
"stateHidden"
当用户选择该Activity时,软键盘被隐藏——也就是,当用户确定导航到该Activity时,而不是返回到它由于离开另一个Activity。
"stateAlwaysHidden"
软键盘总是被隐藏的,当该Activity主窗口获取焦点时。
"stateVisible"
软键盘是可见的,当那个是正常合适的时(当用户导航到Activity主窗口时)。
"stateAlwaysVisible"
当用户选择这个Activity时,软键盘是可见的——也就是,也就是,当用户确定导航到该Activity时,而不是返回到它由于离开另一个Activity。
"adjustUnspecified"
它不被指定是否该Activity主窗口调整大小以便留出软键盘的空间,或是否窗口上的内容得到屏幕上当前的焦点是可见的。系统将自动选择这些模式中一种主要依赖于是否窗口的内容有任何布局视图能够滚动他们的内容。如果有这样的一个视图,这个窗口将调整大小,这样的假设可以使滚动窗口的内容在一个较小的区域中可见的。这个是主窗口默认的行为设置。
"adjustResize"
该Activity主窗口总是被调整屏幕的大小以便留出软键盘的空间。
"adjustPan"
该Activity主窗口并不调整屏幕的大小以便留出软键盘的空间。相反,当前窗口的内容将自动移动以便当前焦点从不被键盘覆盖和用户能总是看到输入内容的部分。这个通常是不期望比调整大小,因为用户可能关闭软键盘以便获得与被覆盖内容的交互操作。
bug:
全屏状态下 adjustResize 不响应 只能用adjustpan,且webview 全屏状态下 adjustpan响应也不够好 有时无响应。
http://code.google.com/p/android/issues/detail?id=5497
Issue 5497: | adjustResize windowSoftInputMode breaks when activity is fullscreen | |
30 people starred this issue and may be notified of changes. | Back to list |
Reported
by cherylse...@gmail.com, Dec 16, 2009
I am on Android 1.5 r3. I have a very simple activity with a vertical linear layout that contains an edit text, and a text view with a green background that occupies all extra available space (layout weight = 1). When I focus on the edit text field, the keyboard appears and the screen should get adjusted so that the green text view shrinks vertically (resizes) and the text is still centered vertically within the visible green space. This works great, except when I make the activity fullscreen - either by setting the activity's theme to Theme.NoTitleBar.Fullscreen or by programatically setting the FLAG_FULLSCREEN window flag. If I use Theme.NoTitleBar things are fine. Also, I should mention that our device's screen is landscape (800x480) so I have implemented a keyboard whose InputMethodService subclass overrides onEvaluateFullscreenMode, always returning 'false' in order to stay in 'adjust resize keyboard mode' instead of going into 'fullscreen keyboard mode'.
Comment 1 by burke.e...@gmail.com, Jan 31, 2010
I see this as well. For my layout, I have a vertical LinearLayout. Within it, I have these children from top to bottom: TextView, ListView, EditText, and finally a horizontal LinearLayout, which in turn contains a button. In my AndroidManifest.xml, I specified android:windowSoftInputMode="adjustResize", and it works. The ListView shrinks as expected. But when I change my theme to @android:style/Theme.Light.NoTitleBar.Fullscreen, the adjustResize fails. My button at the bottom of the screen is obscured, and sometimes part of the EditText is obscured until I start typing.
Comment 2 by burke.e...@gmail.com, Jan 31, 2010
Just to add a bit of detail to my previous comment: I see the failure on Android 1.6 on my G1 phone.
Comment 3 by burke.e...@gmail.com, Jan 31, 2010
Also tested on Android 2.1 in emulator - still fails there
Comment 4 by crazybob...@gmail.com, Mar 1, 2010
Does someone have a workaround? I suppose I could use a fixed height for my layout and tweak it when the keyboard displays, assuming I can compute the size of the remaining screen area.
Comment 6 by m.kin...@gmail.com, Apr 24, 2010
I would like to voice my opinion that a notification when the keyboard goes away would be very helpful. I too am using a Fullscreen view, so I am stuck without an option to know when the keyboard disappears. I _am_ using a fixed height for the keyboard because the current mechanisms don't seem to work for fullscreen. But when the user presses the back button, the IME eats it and there's no notification or onSizeChanged to know when the keyboard goes away. Why is it so hard to provide a notification when the keyboard goes away?
Comment 7 by lucian...@gmail.com, Aug 5, 2010
Hello i have a relativeLayout at the top, then below i have a listView in the center and finaly at the bottom i have other relativeLayout with an editText and a button inside. I want to the listview resize when click the editText and the IME(virtual keyboard) appear. If i put adjustResize in the manifest, the listview is resized to leave space for the IME, but the relativeLayout with the editText that is below is cover by the IME and i can't see what i am writing. If i put adjustPan, the keyboard push up all, the listview is not resized and i loose the top relativeLayout. D: PLEASE HELP!!!!
Comment 8 by revanth....@gmail.com, Sep 9, 2010
i am facing the same issue what others are facing...if any one solve please let me know.
Comment 9 by falar...@gmail.com, Oct 12, 2010
I'm running into this same issue with an activity that has an embedded WebView. The input field keyboard focus doesn't work right without adjustResize turned on, but adjustResize doesn't work in full screen mode. This means that this is the only activity in my app that shows the status bar. At the very least there should be something in the documentation that says that this combination doesn't (or isn't supposed to) work.
Comment 10 by project
member romannu...@google.com, Oct 13, 2010
Relevant post from hackbod: https://groups.google.com/group/android-developers/msg/5690ac3a9819a53b
Comment 12 by whoop....@gmail.com, Feb 1, 2011
Please patch the OS so that adjustPan is honored in a fullscreen webview : When a keyboard slides up in a fullscreen webview, the input field clicked on should slide up (remaining visible). Otherwise, web designers cannot place input fields on the bottom 2/3rds of a screen.
Comment 13 by hopfc...@gmail.com, Feb 23, 2011
I can confirm this issue. As soon as you set your activity to fullscreen the windowSoftInputMode:adjustResize will no longer work. I hope this will get fixed soon as this break alot of layout ideas.
Comment 16 by guiha...@gmail.com, Sep 9, 2011
The same issue occurs in Android 3.1. The notification is also NOT SENT when the device is in LANDSCAPE mode in versions prior to 3.0. (actually i tested it in a Xoom with 3.1 and the notification is sent in LANDSCAPE mode, so i'm just assuming it was fixed in 3.0). The fullscreen problem also occurs in xoom, even if there's no screen diference between full screen and non-full screen in the Xoom.
Comment 17 by akasek, Oct 7, 2011
The last two comments have confirmed Froyo and Honeycomb. I'll confirm Gingerbread also (2.3.4) Also, I interpret the linked post in comment 10 from Diane Hackborn as acknowledgement that this is an unintended effect and should not be the case. Would be nice if this was fixed, because adjustPan does bad things to layouts with headers or footers (pushing them offscreen). In an application which allows the user to select whether to hide the status bar or not, the time when the most space is available is the time when header and footer elements will become unaccessible. It doesn't make sense to behave this way. |
发表评论
-
Android ADT20 下运行第三方包出错
2012-10-18 18:07 3453今天在使用android viewpager时 编译ok 运行 ... -
android Ant混淆打包遇到的几个问题 SDK 升级到4.0后
2012-03-08 11:47 5866第一, BUILD FAILED F:\explor ... -
转:Android推送通知指南
2012-02-20 16:24 1781Android推送通知指 ... -
android 数据传递详解(Serialization、Parcelable、Parcel、Intent、Bundle)
2012-02-10 13:38 37442第一、四大组件间数据传递方式: 启动四大组件通过Int ... -
Android4.0源码在Galaxy Nexus上市后开放
2011-11-02 18:06 1506Android4.0源码在Galaxy Nexus上市后开放 ... -
Adnroid4.0 签名混淆打包(conversion to dalvik format failed with error 1)
2011-10-28 11:26 7918最新Eclipse3.7+android sdk4.0+adt ... -
原:Android 获取屏幕高度、标题高度、状态栏高度详解
2010-11-30 08:29 15105A ndroid 获取屏幕高度、标题高度、状态栏高度详解 ... -
转:android连网详解——android.net、org.apache.http联网实现
2010-09-02 16:56 132621.连网相关包介绍 今天 ... -
Android编译,打包、签名详细教程
2010-08-04 22:19 22116Android编译,打包、签名 ... -
原:Android 命令行手动编译打包详解
2010-08-04 21:55 38982Android 命令行手动编译打包过程图 【详细步骤】 ... -
android aapt (android asset packaging tool)使用详解
2010-07-29 17:56 11666最近在研究android自带的编译 打包工具,关于aapt 这 ... -
eclipse+ADT 进行android应用签名详解
2010-07-23 09:44 245341.Eclipse工程中右键工程,弹出选项中选择 androi ... -
在android market上发布个人应用的步骤
2010-07-22 18:00 2663发布android应用需要在market上注册market d ... -
Android LogCat使用详解
2010-06-22 16:39 40182Android的Logcat用于显示系统的调试信息,可在分别以 ... -
Android 调试之 Log和LogCat的详解
2010-06-22 15:55 34950Android 的调试信息分为 ... -
android 命令大全
2010-06-10 22:18 3067android命令大全 百度文库很全面的文档:http:// ...
相关推荐
总的来说,解决Android输入法弹出时覆盖输入框的问题,关键在于理解`android:windowSoftInputMode`的作用和限制,以及如何通过自定义布局组件来适配全屏模式下的输入法显示。通过这种方式,开发者可以创建出更加流畅...
之前要做一个弹出对话框,填写信息,发现在手机上看的时候,较后的输入框在填写信息时,输入框被输入法遮挡,只能盲填。 前提 1.弹出的对话框用display:fixed定位的 2.对话框大小固定 解决办法 css部分 (dlg-top与...
在Android Studio开发环境中,开发者可能遇到各种问题,其中之一就是“五笔输入法不显示输入框”。这通常是由于系统环境或软件兼容性导致的输入法显示异常。本文将深入探讨这个问题,并提供解决方案。 Android ...
在Android开发过程中,一个常见的问题是在用户打开软键盘或实体输入法时,应用程序的布局会被键盘遮挡,导致部分UI无法正常显示。这种情况通常出现在需要输入文本的界面,如登录、注册、评论等场景。本篇文章将深入...
解决软键盘弹出覆盖输入框问题有多种方法,以下是一些常见的解决方法: 1. 使用position:fixed固定输入框的位置,使其位于软键盘弹出时不被覆盖。 2. 使用transform: translateY()将输入框上移到可视区内,使其不被...
这个问题主要出现在用户与应用交互时,比如点击一个EditText输入框触发输入法弹出,然后通过程序逻辑或者用户操作隐藏了输入法,但在后续的交互中输入法不再自动或手动弹出。针对这个"Android处理输入法隐藏后不再...
在Android应用开发中,经常会遇到一个问题,即当用户在输入框中输入时,弹出的软键盘会遮挡部分屏幕内容,尤其是对于登录或注册等需要填写多项信息的界面,这种情况严重影响了用户体验。为了解决这个问题,Android...
在Android平台上,开发一款车牌号输入法涉及到许多技术细节和用户体验设计。首先,我们要了解车牌号输入法的主要功能,即为用户提供快速、准确输入车辆识别号码(VIN)或地方规定的车牌号码的方式。以下是一些相关的...
在Android游戏开发中,自定义UI元素是提升用户体验和满足特定设计需求的重要手段。本教程主要探讨如何抛弃系统默认的输入框(EditText)并自己实现一个功能完备的输入框组件,以适应游戏场景的需求。 首先,我们...
在实际项目中,你可能还会遇到更多细节,如键盘弹出与输入框位置的调整、输入框的浮层效果、自定义输入法的处理等。通过深入理解并实践这些知识点,你可以创建出一个功能完备且用户体验良好的输入框组件。
为了解决这个问题,我们可以使用`android:layout_marginTop="-25dp"`,让布局向上延伸,覆盖状态栏的高度(假设状态栏高度为25dp)。请注意,这要求状态栏是透明的,因此可能还需要在Java代码中进行额外的设置,例如...
将底部菜单的`position`从`fixed`改为`absolute`,以避免它被输入法覆盖。但是,这种方法并不总是有效,因为在某些情况下,输入法仍然可能会推移并遮挡底部菜单。 此外,可以利用Android设备特有的`window.onresize...
除了上述方法,还可以在`AndroidManifest.xml`中针对特定Activity设置`android:windowSoftInputMode="adjustResize"`,这样当输入法弹出时,系统会自动调整Activity大小,使得输入框始终可见。 5. **处理不同设备...
在Android应用开发中,用户界面的设计和交互是至关重要的,特别是在聊天应用中,软键盘的弹出和隐藏以及与底部布局的交互直接影响到用户体验。本文将深入探讨如何在Android中实现软键盘与聊天页面底部布局之间的优雅...
`android:windowSoftInputMode="adjustPan"`表示当输入法弹出时,Activity的布局会自动上移,以便用户可以看到输入的内容。如果希望键盘覆盖一部分屏幕,可以使用`android:windowSoftInputMode="adjustResize"`。 ...
在Android应用开发中,创建自定义的数字键盘和密码输入框是常见的需求,尤其是在涉及到金融、支付等场景时,为了提供更好的用户体验和安全性,开发者往往需要脱离系统默认的软键盘,设计符合应用风格的数字输入界面...
标题“输入法布局练习”指的是开发者通过实践来熟悉和掌握Android系统中关于输入法布局的相关设置,特别是当输入法位于屏幕最下端时的场景。 描述中提到的“windowSoftInputMode”是AndroidManifest.xml文件中...
- 针对输入法覆盖输入框的问题,可以使用`android:windowSoftInputMode="adjustPan"`属性让输入框自动上移。 总之,理解和熟练掌握Android中的`InputMethodManager`类对于优化用户体验至关重要,因为它直接影响到...
- 检查输入法服务是否正确配置,例如`android:windowSoftInputMode`属性设置为`adjustResize`或`adjustPan`,确保输入法弹出时应用界面能正确调整。 - 确保输入法服务在运行时被正确启动,可以在设置中手动选择或...