IBM Worklight - iOS 7状态栏与应用程序的HTML重叠

问题描述:

在我的应用程序中,HTML的顶部是状态栏的一半。我在该部分有一个按钮,现在无法点击。

In my application, the top of the HTML is half way into status bar. I have a button in that section that is now impossible to click.

我不知道为什么会这样做。我有标准的视口行(width = device-width)。
有什么想法吗?或者如何调整它?

I don't know why it would do this. I have the standard viewport line ("width=device-width").
Any ideas? Or how to adjust it?

除了以上Idan给出的步骤之外,你可以尝试在iOS中使用一个偏好隐藏状态栏。

Apart from the steps given by Idan above, you can try using one preference in iOS which hides the statusbar.

尝试将以下方法添加到应用程序的根视图控制器中:

Try adding the following method to your app's root view controller:



  • (BOOL)prefersStatusBarHidden {
    返回YES; }

或者你可以在确定iOS版本后在顶部添加20px空间

Or you can add 20px space on the top after determining the iOS version


function onDeviceReady(){

function onDeviceReady() {

if (parseFloat(window.device.version) === 7.0) {
       document.body.style.marginTop = "20px";
} 

}

document.addEventListener('deviceready',onDeviceReady,false);

document.addEventListener('deviceready', onDeviceReady, false);