移动端唤醒软键盘布局
来源:互联网 发布:淘宝客机器人多少钱 编辑:程序博客网 时间:2024/05/17 18:47
在移动端开发中,经常会有 fixed 元素和输入框(input 元素)同时存在的情况。 但是 fixed 元素在有软键盘唤起的情况下,会造成原本布局的混乱问题,因为在IOS端软键盘唤醒后,fixed布局会失效,软键盘会把输入框顶起来(但是输入框不会贴近键盘底部),最近做了项目的评价功能,结合了安卓和IOS中布局的表现问题,写了一个DEMO,经过测试,可以完美解决这个问题
<style> /*视图头部*/ header { position: fixed; height: 50px; left: 0; right: 0; top: 0; z-index: 9; width: 100%; background: greenyellow; } /*视图底部*/ footer { position: fixed; height: 34px; left: 0; right: 0; bottom: 0; z-index: 9; background: greenyellow; } /*视图内容区域*/ .box { position: absolute; top: 50px; bottom: 34px; overflow-y: scroll; height: 2000px; } </style>
<body> <header> header </header> <!--内容视图区域--> <div class="box"> <!--内容视图--> </div> <footer> <input type="text" placeholder="请填写商品评论。。。" /> <button class="submit">提交</button> </footer> </body>
阅读全文
0 0
- 移动端唤醒软键盘布局
- Android 软键盘弹出自动移动布局
- 关于html页面移动端软键盘弹出时影响页面布局的问题
- Html5(移动端)开发,安卓机上的软键盘顶起影响页面布局
- Android之全屏下软键盘弹出布局移动问题
- 移动端弹出软键盘页面变形
- 软键盘顶布局
- 【正确姿势】解决EditText软键盘引起的其他布局移动问题
- android 软键盘遮挡布局
- 软键盘弹出布局上移
- 当移动端软键盘弹出时错位问题解决方案
- android 移动端开发之软键盘一系列大全
- js 移动端之监听软键盘弹出收起
- 移动端 Web 页 input 控制软键盘
- 移动端 Web 页 input 控制软键盘
- android 软键盘移动焦点 转载
- android 软键盘布局 及 关闭 弹出
- android布局被软键盘顶上去
- XMLHttpRequest cannot load file. Cross origin requests are only supported for HTTP angularjs
- 关于Oracle中日期类型的查询及模糊查询
- SpringMVC中各种监听器的作用
- 指针
- Mysql 删除外键之后 自增长不连续 解决方案
- 移动端唤醒软键盘布局
- 刷题
- Java 自定义比较器
- mysql报错Error Code: 1022. Can't write; duplicate key in table `xxx`
- JavaScript学习总结(十六)——Javascript闭包(Closure)
- ImageLoader的Application
- bzoj3682
- Maven项目使用爬虫需要添加的jar包
- Mybatis系列之集合映射