ios - Cordova - 使用固定页眉和页脚滚动 (ios)

标签 ios css cordova scroll

使用Cordova (phonegap) & bootstrap 制作一个移动应用程序,目前在IOS 上测试。

修复了页眉和页脚栏的问题,中间有可滚动内容。点击滚动时,页眉/页脚栏会随着内容上下移动,但在滚动完成后会立即回到原位。如果我使用

-webkit-overflow-scrolling: touch;

它按预期工作,但滚动浏览内容真的很尴尬,如果滚动到末尾,它只会滚动页眉或页脚( flex 溢出),直到你停下来一秒钟。

这是我的页眉/页脚栏的 html:

<div id="headerBar">
        <div class="container-fluid" style="background-color: #1569C7">
            <div class="row">
                <div class="col-xs-3 text-left">
                    <button id="logoutButton" type="button" class="btn btn-default">
                        Log Out
                    </button>
                    <button type="button" class="btn btn-default" id="restoreQuestionFeedButton">
                        <span class="glyphicon glyphicon-chevron-left"></span>
                    </button>
                </div>
                <div class="col-xs-6 text-center" style="height: 55px">
                    <strong id="usernameText"></strong>
                </div>
                <div class="col-xs-3 text-right">
                    <button id="oldCreatQuestionButton" type="button" class="btn btn-default">
                        <span class="glyphicon glyphicon-plus"></span>
                    </button>
                </div>
            </div>
        </div>
    </div>
<div id="footerBar">
        <div class="container-fluid" style="padding: 0">
            <div class="row text-center">
                <button id="createQuestionButton" type="button" class="btn btn-default footerButton">
                    <span class="glyphicon glyphicon-plus"></span> <strong>Ask a new free question!</strong>
                </button>
            </div>
        </div>
    </div>

这是相关的 CSS:

#headerBar {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #1569C7;
}

#footerBar {
    position: fixed;
    z-index: 100; 
    bottom: 0; 
    left: 0;
    width: 100%;
    background-color: #1569C7 !important;
}

最佳答案

在我的例子中,我通过删除“position: fixed”之后的“top: 0”来修复这个错误

它是固定的!

关于ios - Cordova - 使用固定页眉和页脚滚动 (ios),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23957885/

相关文章:

ios - 错误 ITMS-90171 : "Invalid Bundle Structure - The binary file ' XYZ. app/abc.bundle/Contents/MacOS/Abcbundle' is not permitted

iOS:在首次销售时以编程方式更改应用内购买的价格等级(向所有用户出售 IAP 限制时间?)

ios - UIPageViewController 和 setViewControllers :

javascript - 如何删除jquery mobile中已经打开的弹出窗口

android - 添加依赖项时出现编译错误:com.google.firebase:firebase-core

php - React native http post 得到 Json Parse 错误 : Unrecognized token '<'

javascript - 为什么我的 CSS Shape 被 chop 了

jquery - 从特定标签中删除样式属性

javascript - 自定义布局以及 Bootstrap

android - ionic cordova build android找不到模块 '../pages/Wallet/'