Phonegap+Android固定头部和底部工具栏的方法
来源:互联网 发布:linux 复制全部内容 编辑:程序博客网 时间:2024/05/17 02:30
方法1、通过CSS代码如下:
<html><head><style> .TOP_TOOLBAR, .BOTTOM_TOOLBAR { height: 50px; width: 100%; position: absolute; } .TOP_TOOLBAR { top: 0; } .BOTTOM_TOOLBAR { bottom: 0; } .SCROLLER_FRAME { width: 100%; position: absolute; top: 50px; bottom: 50px; }</style></head><body> <div class=”TOP_TOOLBAR”> ... toolbar content ... </div> <div class=”SCROLLER_FRAME”> <div class=”SCROLLER”> ... scrollable content ... </div> </div> <div class=”BOTTOM_TOOLBAR”> ... toolbar content ... </div></body></html>
方法2、通过脚本计算屏幕的高度与宽度以及头部工具栏和底部工具栏的高度,确定中间内容区域的高度,代码如下:
function SetHeight() { var headerH = document.getElementById('index_header').offsetHeight; var footerH = document.getElementById('index_footer').offsetHeight; var contentH = 0; var tUserAgent = navigator.userAgent; //由於Windows Phone不支援windows.innerHeight語法,改用screen代替 if (tUserAgent.indexOf("Windows Phone") != -1) { contentH = screen.availHeight - headerH - footerH; } else { contentH = window.innerHeight - headerH - footerH; } document.getElementById("index_content").style.height = contentH + "px"; }
- Phonegap+Android固定头部和底部工具栏的方法
- 头部底部固定的另一种实现方式
- Android为RecyclerView添加头部底部的简单方法
- 头部和底部固定,中间内容可滚动
- 使用flex固定头部和底部中间滚动
- 表格固定头部,底部,左侧
- 简单实现Android顶部工具栏和底部工具栏
- 简单实现Android顶部工具栏和底部工具栏
- 简单实现Android顶部工具栏和底部工具栏
- 简单实现Android顶部工具栏和底部工具栏
- android固定头部和侧边表格实现
- dede头部导航和底部的调用
- html 引入公共的头部和底部
- android ScrollView和ListView固定底部
- 页脚固定于底部的方法
- Android RecycleView设置头部或者底部视图,给固定高度失效问题
- Android开发之RecyclerView添加头部和底部
- android 下拉刷新可自定义刷新头部和底部
- 好玩的vim在线教程
- 判断链表是否有环
- mysql数据库字段类型大全
- peterzb(个人开发历程知识库 - 博客园)
- ACM推荐
- Phonegap+Android固定头部和底部工具栏的方法
- 软件工程之软件测试
- 【整理】Linux驱动中,probe函数何时被调用
- jad ubunt安装
- mongodb的java driver执行“原生查询”语句
- 第一次正式编程
- Java,Perl,Python 比较
- Oracle Database 11gR1 和 10gR2 ASM Best Practices 说明文档
- 为何要用GT-欣方公司内部整理资料