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和表情按钮等 ...
随机推荐
- Elasticsearch中文文档,内容不全
注意 内容不全,这是观看中文文档进行操作的 文档地址 旧版中文文档,部分内容过期 https://www.elastic.co/guide/cn/elasticsearch/guide/current ...
- kafka核心原理总结
新霸哥发现在新的技术发展时代,消息中间件也越来越受重视,很多的企业在招聘的过程中着重强调能够熟练使用消息中间件,所有做为一个软件开发爱好者,新霸哥在此提醒广大的软件开发朋友有时间多学习. 消息中间件利 ...
- 00-A-springmvc分布式项目项目结构
项目使用IDEA进行开发 一个分布式项目基本需要的模块. 用到的技术spring+springmvc+mybatis+dubbo +mysql+redis 01模块名字:p2p-parent 作为父模 ...
- windows下双击可运行的Java软件打包方案(转)
出处: http://www.cnblogs.com/shiyangxt/ 刚开始学Java的时候,挺郁闷的,写出来的java类文件,需要dos下编译,然后再dos下运行看效果.这使初学者常常 觉得麻 ...
- jvm中的新生代Eden和survivor区
1.为什么会有年轻代 我们先来屡屡,为什么需要把堆分代?不分代不能完成他所做的事情么?其实不分代完全可以,分代的唯一理由就是优化GC性能.你先想想,如果没有分代,那我们所有的对象都在一块,GC的时候我 ...
- [易学易懂系列|rustlang语言|零基础|快速入门|(21)|智能指针]
[易学易懂系列|rustlang语言|零基础|快速入门|(21)|智能指针] 实用知识 智能指针 我们今天来讲讲Rust中的智能指针. 什么是指针? 在Rust,指针(普通指针),就是保存内存地址的值 ...
- 基于初始种子自动选取的区域生长(python+opencv)
算法中,初始种子可自动选择(通过不同的划分可以得到不同的种子,可按照自己需要改进算法),图分别为原图(自己画了两笔为了分割成不同区域).灰度图直方图.初始种子图.区域生长结果图.另外,不管时初始种子选 ...
- 【2019银川网络赛】L:Continuous Intervals
题目大意:给定一个长度为 N 的序列,定义连续区间 [l, r] 为:序列的一段子区间,满足 [l, r] 中的元素从小到大排序后,任意相邻两项的差值不超过1.求一共有多少个连续区间. 题解:单调栈 ...
- 不知如何摧毁Kendo UI for jQuery小部件?这份指南不得不看
[Kendo UI for jQuery最新试用版下载] Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support ...
- Notepad++设置快捷键及外部命令
<NotepadPlus> <InternalCommands> <Shortcut id="41020" Ctrl="no" A ...