最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Android屏蔽软键盘自动弹出的解决方案
时间:2017-01-07 编辑:简简单单 来源:一聚教程网
问题概述
在编辑框输入内容时会弹出软键盘,而手机屏幕区域有限往往会遮住输入界面,我们先看一下问题效果图:
输入用户名和密码时,系统会弹出键盘,造成系统键盘会挡住文本框的问题,如图所示:
输入密码时输入框被系统键盘遮挡了,大大降低了用户操作体验,这就是开发中非常常见的软键盘遮挡的问题,该如何解决?
简单解决方案
方法一:
在你的activity中的oncreate中setContentView之前写上这个代码
方法二:
在EditText的属性上加上:
如下所示:
代码如下 | 复制代码 |
android:id="@+id/edt_regist_user"
android:layout_width="0dp"
android:layout_weight="3"
android:layout_height="wrap_content"
android:hint="任意字母,数字"
android:editable="false"
android:textColor="@color/colorGray"
android:background="@color/colorHyalin"
android:textSize="16sp"
/>
|
相关文章
- sora软件价格介绍 02-22
- sora官网入口地址一览 02-22
- Sora生成的视频使用教程 02-22
- 《梦幻西游》元宵灯谜线索答案大全2024 02-22
- 《原神》有朋自远方来第一天通关攻略 02-22
- 《苏醒之路》四个结局达成攻略 02-22