【问题标题】:Dojo app header and footer are not fixed positioned in Windows and iPhoneDojo 应用程序页眉和页脚在 Windows 和 iPhone 中的位置不固定
【发布时间】:2016-01-07 01:51:44
【问题描述】:

我们正在使用 IBM MobileFirst 7.0 和 dojox 1.8 作为脚本语言开发混合应用程序。

我遇到了 UI 页眉和页脚的问题,这些问题在 windows 和 iphone 中未修复,但相同的代码在 Android 上运行良好。

即,对于标题,我们使用标签并给出 data-dojo-props:"fixed:top" 作为标题。
对于页脚,我们使用标签并为页脚提供data-dojo-props:"fixed:bottom"

请问有什么解决办法吗?

<div data-dojo-type="dojox.mobile.ScrollableView" id="Login_en_View_Id"
    data-dojo-props="selected:false">

    <h1 class="test" data-dojo-type="dojox.mobile.Heading" data-dojo-props="fixed:'top'"></h1>

    <div class="margin">

        <label >Text:</label> <input class="clearFields"
            data-dojo-type="dojox.mobile.TextBox" >

        <label>Code</label> <input class="clearFields"
            data-dojo-type="dojox.mobile.TextBox">


        <button data-dojo-type="dojox.mobile.Button" class="englishFont">Login</button> 

        <button data-dojo-type="dojox.mobile.Button" class="englishFont">REGISTER</button>


    </div>

    <h2  class="test1" data-dojo-type="dojox.mobile.Heading" data-dojo-props="fixed:'bottom'"></h2>
</div>

CSS代码:

    .test{  
        height: 42px;
        display: table;
        line-height: 0px;
    }
   .test1{
        height: 44px;
   }

【问题讨论】:

  • 这是一个编程网站。提供您的实现,以便可以重新创建和调试它。还要确认您指的是 Windows 8 还是 Windows Phone 8。
  • 我们指的是 windows phone 8 和 iphone

标签: iphone windows-phone-8 dojo ibm-mobilefirst


【解决方案1】:

我不确定您所说的“不固定位置”是什么意思。
我已经使用了您的代码,并且页眉和页脚确实固定定位到顶部和底部。

我认为您可能指的是您可以滚动页面,并且页眉/页脚与您一起移动(但请注意,它仍然固定在“顶部/底部")。

要“修复”这个问题,您可以将以下内容放在 wlCommonInit() 函数的开头:

document.ontouchmove = function(event){
    event.preventDefault();
}

这是非常基本的,但有效。将不再滚动。
您可以在此处找到其他解决方案:iPhone Web App - Stop body scrolling

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-11-05
    • 1970-01-01
    • 2014-07-07
    • 2016-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-30
    相关资源
    最近更新 更多