Android Phonegap Compilations在应用程序的底部添加栏,不应该有? [英] Android Phonegap Compilations adds bar at the bottom of app that should not be there?

查看:211
本文介绍了Android Phonegap Compilations在应用程序的底部添加栏,不应该有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到无处不在,尝试了一切,但我不能摆脱这个随机的黑色条纹出现在我的PhoneGap应用程序的底部。这是我在运行应用程序时看到的:

I've looked everywhere and tried just about everything, but I can't get rid of this random black bar appearing at the bottom of my PhoneGap App. This is what I am seeing when I run the app:

有趣的部分是,如果我最小化应用程序,然后再次打开它,它会自动修复显示,底部栏消失。但为什么?!如何才能让应用程式开启时不显示此栏?

The interesting part is that if I minimize the app and then open it again, it automatically fixes the display and the bottom bar disappears. But why?! How can I get it to not show this bar from the moment the app opens?

此外,桌面电脑上的Chrome不会显示这项功能。它只发生在应用程序编译后build.phonegap.com。

Also, this does not happen in Chrome on my desktop computer. It only happens after the app is compiled at build.phonegap.com.

我要查询的内容

此问题似乎描述了我的问题,但我已经尝试过一切讨论,但没有运气。它提到如果你有:

This question seems to describe exactly my problem, but I've tried everything discussed there but with no luck. It mentions that if you have:

<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0, height=device-height, width=device-width"/>

您应该尝试:


  1. 完全移除视口中继标记(无效)

  2. 只移除「高度」部分。也就是说height = device-height(did not work)

更多建议似乎说:是的,这是一个jQuery移动问题。

More advice there seems to say: "Yes, it's a jquery mobile issue. The style is set whenever the viewport size changes."

为此,我尝试设置CSS:

For this I tried setting CSS:

 .ui-page-active {
     height: 100% !important;
     min-height: 100% !important;
 }

无法使用...

那么我想,也许如果我可以愚弄的应用程序调整窗口大小,这可能工作。所以我试着添加:

So then I thought, maybe if i can "fool" the app into resizing the window, that might work. So I tried adding this:

$(window).trigger("resize");

无法使用。

认为好,也许这是我的代码中的别的。所以我把整个文件剥离到一个只有一个索引div的VERY barebones文件。它还发生了。

Then I thought okay, maybe it's something else in my code. So I stripped down the entire file to a VERY barebones file with ONLY one index div. And it STILL happened.

我也试过fiddling与config.xml。我编辑了这个:

I also tried fiddling with config.xml. I edited this:

<preference name="fullscreen"                 value="true" />

并更改为:

<preference name="fullscreen"                 value="false" />

这没有区别。

也确保我有一切的最新版本(和我做)。我有:

I also made sure I have the latest versions of everything (and I do). I have:


  • jQuery Mobile版本1.4.5

  • jQuery v1.11.2

我还发现此帖描述相同的事情。但没有解决方案。 (甚至提供了一个赏金,希望引起一些注意)

I also found this post describing the same thing. But no solution there either. (Even offered a bounty on there with the hope of drawing some attention)

所以我真的在这里的选择。任何人谁可以给我任何线索,我缺少什么设置或我做错了,导致这个讨厌的酒吧出现在我的应用程序的底部,将是我的英雄。任何建议?

So I'm really out of options here. Anyone who could give me any clues as to what setting I am missing or what I am doing wrong that is causing this annoying bar to show up at the bottom of my app, would be my hero. Any advice?

推荐答案

我遇到了同样的问题只使用< preference name =Fullscreen value =true/> 在我的 config.xml 中。

I experienced the very same issue using only <preference name="Fullscreen" value="true" /> in my config.xml.

最初想到的Android状态栏,但有一些研究的话题,现在得到一个非常坚定的信心,这个问题来自一些其他Android系统UI没有被隐藏,直到Cordova包装器完成初始化,导致错误的计算大小

I initially thought of the Android status bar, but had some research on that topic and now got a very strong believe, that this issue comes from some other Android system UI not being hidden until the Cordova wrapper finished init, resulting in a wrong calculated size for the wrapper.

经过长时间的搜索和尝试几乎所有你在其他线程中提到的,我偶然发现了一个插件:

After a long search and trying out nearly everything you also mentioned in your other thread, I stumbled upon a plugin:

https://github.com/mesmotronic/cordova-plugin-fullscreen

我现在在confix.xml中使用这个。

I'm now using this in the confix.xml

<preference name="Fullscreen" value="true" />
<preference name="AndroidLaunchMode" value="singleInstance" />
<preference name="DisallowOverscroll" value="true" />
<preference name="KeepRunning" value="true" />

这直接在 deviceready触发的方法的第一次播放

if (AndroidFullScreen) {
    // Extend your app underneath the status bar (Android 4.4+ only)
    AndroidFullScreen.showUnderStatusBar();

    // Extend your app underneath the system UI (Android 4.4+ only)
    AndroidFullScreen.showUnderSystemUI();

    // Hide system UI and keep it hidden (Android 4.4+ only)
    AndroidFullScreen.immersiveMode();
}

迄今为止使用Android 6.0,5.0.1测试,包含harware导航和软件导航设备。也许这也可以帮助你。

Tested so far with Android 6.0, 5.0.1 with harware navigation and software navigation devices. Maybe that could help you aswell.

这篇关于Android Phonegap Compilations在应用程序的底部添加栏,不应该有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆