为了实现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弹出软键盘实现页面标题头不动,软键盘弹出在编辑框下面的更多相关文章

  1. android软件简约记账app开发day10-主页面模块--头信息的展示,和之后功能完善的目标。

    android软件简约记账app开发day10-主页面模块--头信息的展示,和之后功能完善的目标. 今天来写主界面头信息的展示,也就是将第一天的写的layout中的item_main_top展示到主界 ...

  2. Android软键盘弹出,覆盖h5页面输入框问题

    之前我们在使用vue进行 h5 表单录入的过程中,遇到了Android软键盘弹出,覆盖 h5页面 输入框 问题,在此进行回顾并分享给大家: 系统:Android 条件:当输入框在可视区底部或者偏下的位 ...

  3. H5页面 绝对定位元素被 软键盘弹出时顶起

    H5页面 绝对定位元素被 软键盘弹出时顶起 在h5页面开发的过程中,我们可能会遇到下面这个问题,当页面中有输入框的时候,系统自带的软盘会把按钮挤出原来的位置.那么我们该怎么解决呢?下面列出一下的方法: ...

  4. Android EditText不弹出输入法总结,焦点问题的总结

    看一个manifest中Activity的配置,如果这个页面有EditText,并且我们想要进入这个页面的时候默认弹出输入法,可以这样设置这个属相:android:windowSoftInputMod ...

  5. Android EditText 不弹出输入法

    当第一次进入一个activity的时候  一般是第一个edittext是默认选中的,但是该死的软键盘也一起弹出来了 那是相当的不美观哈!(#‵′)凸.为此, 本大人就去寻找在刚进入这个activity ...

  6. Android EditText不弹出输入法焦点问题的总结

    转自:http://mobile.51cto.com/aprogram-403138.htm 看一个manifest中Activity的配置,如果这个页面有EditText,并且我们想要进入这个页面的 ...

  7. 如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题

    如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题 如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题 在android中有时候可能要实现一个底部弹 ...

  8. Android EditText默认不弹出输入法,以及获取光标,修改输入法Enter键的方法

    一.Android EditText默认不弹出输入法的办法:1. 在AndroidManifest.xml中将需要默认隐藏键盘的Activity中添加属性即可(常用此方法) android:windo ...

  9. Android EditText软键盘显示隐藏以及“监听”

    一.写此文章的起因 本人在做类似于微信.易信等这样的聊天软件时,遇到了一个问题.聊天界面最下面一般类似于如图1这样(这里只是显示了最下面部分,可以参考微信等),有输入文字的EditText和表情按钮等 ...

随机推荐

  1. Hybrid APP架构设计

    通讯 作为一种跨语言开发模式,通讯层是Hybrid架构首先应该考虑和设计的,往后所有的逻辑都是基于通讯层展开. Native(以Android为例)和H5通讯,基本原理: Android调用H5:通过 ...

  2. 织梦DEDECMS 5.7文章列表第一页dedefield.content

    功能介绍:有很多DEDEcms使用者,在二级文章列表中加入了{dede:field.content/},但在二级栏目中的每一页列表中都存在内容:使用该功能可以只在第一页显示. 注意:只针对最新dede ...

  3. 5.(基础)tornado异步

    终于到了传说中的异步了,感觉异步这个名字听起来就很酷酷的,以前还不是多擅长Python时,就跑去看twisted的源码,结果给我幼小的心灵留下了创伤.反正包括我在内,都知道异步编程很强大,但是却很少在 ...

  4. Could not determine which “make” command to run. Check the “make” step in the build configuration

    环境: QT5.10 VisualStudio2015 错误1: Could not determine which “make” command to run. Check the “make” s ...

  5. tornada-数据库

    数据库 torndb安装 连接初始化 执行语句 execute execute_rowcount 查询语句 get query 与Django框架相比,Tornado没有自带ORM,对于数据库需要自己 ...

  6. Zookeeper常见问题FAQ

    Zookeeper 常见问题FAQ 1.Zookeeper设置权限之坑 大家都知道,zookeeper创建节点默认的权限为:world:anyone:crdwa 设置权限时,当不小心设置成只读r,那么 ...

  7. vsftpd启动报错:vsftpd:500 OOPS: bad bool value in config file for: anonymous_enable

    vsftpd启动报错:vsftpd:500 OOPS: bad bool value in config file for: anonymous_enable  今天在调试centos vsftp的时 ...

  8. 绑定与非绑定方法及反射,isinstance和issubclass内置函数

    目录 绑定方法与非绑定方法 1.绑定方法 2.非绑定方法(staticmethod) isinstance和issubclass 内置函数 1.isinstance 2.issubclass 反射(面 ...

  9. 【leetcode】1187. Make Array Strictly Increasing

    题目如下: Given two integer arrays arr1 and arr2, return the minimum number of operations (possibly zero ...

  10. .netcore mongodb 分页+模糊查询+多条件查询

    .netcore MongoDB.Driver 版本才2.8 与aspnet差距太大,网上找很多资料没有现成的代码. public override async Task<PagerList&l ...