Luc*_*ota 5 xml keyboard layout android
我正在这个登录屏幕上工作,我希望在显示 IME 时调整所有字段、文本和按钮的大小。我已经在 androidManifest.xml 上使用了 android:windowSoftInputMode="adjustResize",但我仍然在其他元素下面得到一些元素。
如果 TextView“Cadastre Agora”(id= 地籍)仍然被虚拟键盘覆盖,这并不重要。但是,我希望至少 EditTexts、它们的 TextViews 和按钮是可见的。
我发现这个悬而未决的问题可能是一个有趣的方法:http://stackoverflow.com/questions/6484024/soft-keyboard-keep-one-view-stationary-while-moving-other
感谢您的帮助!
没有输入法的屏幕:http : //imageshack.us/photo/my-images/138/semttulo2mr.png/
带有 IME 的屏幕(TextView1 变为隐藏):http : //imageshack.us/photo/my-images/404/semttulo3xw.png/
Stackoverflow 抱怨我的代码格式,所以我在这里上传了 xml 文件:https://rapidshare.com/files/1767398103/login.xml 而且我不能发布超过 2 个链接,这就是我在其中添加空格的原因。
在这种情况下,我想说你的初始布局(没有显示键盘)已经有问题了。鉴于您正在创建看起来纯粹是登录屏幕的内容,因此可以将所有控件放置在屏幕的上半部分,并在用户访问该页面时自动显示键盘。这使得用户体验更快,并且您不必想出灵活的布局。
但是,如果您想尝试使布局在两个视图中都有效,则需要将控件之间的间距更改为动态。
例如:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width = "fill_parent"
android:layout_height = "fill_parent"
android:orientation="vertical"
>
<Space
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_weight="1">
<!-- Username Controls here -->
<Space
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_weight="1">
<!-- Password Controls here -->
<Space
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_weight="1">
<!-- Login Button here -->
<Space
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_weight="1">
<!-- TextView here -->
<Space
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_weight="1">
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
为了使其正常工作,必须从控件中删除所有垂直填充,但文本框标签之间的填充除外。
| 归档时间: |
|
| 查看次数: |
8721 次 |
| 最近记录: |