最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Android屏蔽软键盘自动弹出的解决方案
时间:2022-11-14 22:17:54 编辑:袖梨 来源:一聚教程网
问题概述
在编辑框输入内容时会弹出软键盘,而手机屏幕区域有限往往会遮住输入界面,我们先看一下问题效果图:
输入用户名和密码时,系统会弹出键盘,造成系统键盘会挡住文本框的问题,如图所示:
输入密码时输入框被系统键盘遮挡了,大大降低了用户操作体验,这就是开发中非常常见的软键盘遮挡的问题,该如何解决?
简单解决方案
方法一:
在你的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"
/>
|
相关文章
- DappM1代币 05-02
- 虚拟币app排行榜 05-02
- 比特币历史最高价 05-02
- TRON是什么币 05-02
- 2025年比特币走势 05-02
- Binance.US已上线VIRTUAL 04-30