Android EditText弹出软键盘实现页面标题头不动,软键盘弹出在编辑框下面
为了实现EditText编辑的时候弹出软键盘标题头不动,底部编辑框,上移在这总结:
RelativeLayout在弹出软键盘的时候先寻找android:layout_alignParentBottom属性是否有控件设置为true,如果有将此控件向上移动键盘高度的位置,布局也就位于软键盘的上面,其他控件如果有相对于该控件的位置,也就相对的移动了,如果没有则什么都不做,可以看做布局是一层一层盖上去的,键盘弹出的时候,只把符合要求的当层的布局向上移动,所以如果我们按照这种方法写,肯定是可以的。
还有一个重点就是,配置文件里面该activity要设置android:windowSoftInputMode=”adjustResize”
遇到设置之后不生效的结果,那就在布局文件的根布局添加android:fitsSystemWindows=”true”属性。
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.shiwen.oil.activity.NoticeDetailActivity"> <ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="3dip"
android:layout_alignParentTop="true"
android:progressDrawable="@drawable/progressbar_drawable"
android:visibility="gone"/> <WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/progressBar"
android:layout_weight="1"/> <RelativeLayout
android:id="@+id/comment_bottom_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:layout_alignParentBottom="true"
> <View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/gray" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"> <RelativeLayout
android:id="@+id/rl"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_weight="3"> <EditText
android:id="@+id/bottom_ed"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="@drawable/shape_gray_solid_bg"
android:hint="写评论"
android:minHeight="35dp"
android:paddingLeft="20dp"
android:paddingRight="5dp"
android:textColorHint="@color/gray"
android:textSize="14sp" />
</RelativeLayout> <Button
android:id="@+id/bottom_bnt"
android:layout_width="0dp"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/rl"
android:layout_weight="1"
android:background="@drawable/shape_base_bg2"
android:text="确认"
android:layout_marginRight="5dp"
android:textColor="@color/white"
android:textSize="13sp" /> </LinearLayout>
</RelativeLayout> </RelativeLayout>
<activity
android:name=".activity.NoticeDetailActivity"
android:windowSoftInputMode="adjustResize"
></activity>
效果图
Android EditText弹出软键盘实现页面标题头不动,软键盘弹出在编辑框下面的更多相关文章
- android软件简约记账app开发day10-主页面模块--头信息的展示,和之后功能完善的目标。
android软件简约记账app开发day10-主页面模块--头信息的展示,和之后功能完善的目标. 今天来写主界面头信息的展示,也就是将第一天的写的layout中的item_main_top展示到主界 ...
- Android软键盘弹出,覆盖h5页面输入框问题
之前我们在使用vue进行 h5 表单录入的过程中,遇到了Android软键盘弹出,覆盖 h5页面 输入框 问题,在此进行回顾并分享给大家: 系统:Android 条件:当输入框在可视区底部或者偏下的位 ...
- H5页面 绝对定位元素被 软键盘弹出时顶起
H5页面 绝对定位元素被 软键盘弹出时顶起 在h5页面开发的过程中,我们可能会遇到下面这个问题,当页面中有输入框的时候,系统自带的软盘会把按钮挤出原来的位置.那么我们该怎么解决呢?下面列出一下的方法: ...
- Android EditText不弹出输入法总结,焦点问题的总结
看一个manifest中Activity的配置,如果这个页面有EditText,并且我们想要进入这个页面的时候默认弹出输入法,可以这样设置这个属相:android:windowSoftInputMod ...
- Android EditText 不弹出输入法
当第一次进入一个activity的时候 一般是第一个edittext是默认选中的,但是该死的软键盘也一起弹出来了 那是相当的不美观哈!(#‵′)凸.为此, 本大人就去寻找在刚进入这个activity ...
- Android EditText不弹出输入法焦点问题的总结
转自:http://mobile.51cto.com/aprogram-403138.htm 看一个manifest中Activity的配置,如果这个页面有EditText,并且我们想要进入这个页面的 ...
- 如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题
如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题 如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题 在android中有时候可能要实现一个底部弹 ...
- Android EditText默认不弹出输入法,以及获取光标,修改输入法Enter键的方法
一.Android EditText默认不弹出输入法的办法:1. 在AndroidManifest.xml中将需要默认隐藏键盘的Activity中添加属性即可(常用此方法) android:windo ...
- Android EditText软键盘显示隐藏以及“监听”
一.写此文章的起因 本人在做类似于微信.易信等这样的聊天软件时,遇到了一个问题.聊天界面最下面一般类似于如图1这样(这里只是显示了最下面部分,可以参考微信等),有输入文字的EditText和表情按钮等 ...
随机推荐
- CentOS MySql5.6编译安装
生产环境中,mysql服务器上边最好什么服务都不要再安装!!! 一.准备工作: # yum -y install make gcc-c++ cmake bison-devel ncurses-deve ...
- Ansible批量远程管理Windows主机(部署与配置)
一.测试环境介绍 Ansible管理主机: 系统: CentOS6.8 IP Addr: 172.16.10.22 Linux管理服务器需安装pip.pywinrm插件 Windows客户端主机: ...
- Liunx 用户权限之目录
总结一下: 今天又对liunx权限的认知多了一点,就是关于目录的权限的作用 可以打个比方来形容就是:相当于一个大门 只有目录权限都有的情况下,才能够对目录中的文件进行目录权限操作 例如:drwxrwx ...
- springboot异常
异常如下: org.springframework.context.ApplicationContextException: Unable to start embedded container; n ...
- jumpserver部署0.3版本 =====( ̄▽ ̄*)b
jumpserver概述 跳板机概述: 跳板机就是一台服务器,开发或运维人员在维护过程中首先要统一登录到这台服务器,然后再登录到目标设备进行维护和操作: 跳板机缺点:没有实现对运维人员操作行为的控制和 ...
- 代码审计-DVWA-命令注入
首先说明,我水平不高,这是我在学习代码审计过程中写的记录笔记,难免有不正之处,还望指出. Windows 10 php7.2.10 + apache DVWA代码审计 命令执行 low <?ph ...
- 使用SpringAOP实现事务(声明式事务管理、零配置)
前言: 声明式事务管理建立在AOP之上的.其本质是对方法前后进行拦截,然后在目标方法开始之前创建或者加入一个事务,在执行完目标方法之后根据执行情况提交或者回滚事务.声明式事务最大的优点就是不需要通过编 ...
- alembic在tornado项目中的应用
在项目中引用alembic 协助tornado项目生成数据表结构 alembic revision --autogenerate -m "create tables" 第二步执行 ...
- html访问全过程
1)解析Web页面的URL,得到Web服务器的域名 2)通过DNS服务器获得Web服务器的IP地址 3)与Web服务器建立TCP连接 4)与Web服务器建立HTTP连接 5)从Web服务器获得URL指 ...
- 【杂题】【CometOJ Contest #5】E:迫真大游戏【概率】【排列组合】【多项式】
Description 有一个n个点的环,有一个指针会从1号点开始向后扫描,每次扫描有p的概率删除当前点 询问每个点最后一个被删除的概率. 答案对998244353取模 n<=200000 So ...