我用 apache cordova 开发了一个 Android 应用程序。我正在使用 angularjs 和 bootstrap。我对某些 Android 设备有问题,这些设备底部有这样的软导航栏。
当软导航栏处于活动状态时,用户无法看到应用程序中的按钮,因为软导航栏与我的按钮面板重叠。
我的页脚代码与此类似。
<div class="col-xs-12 navbar-inverse navbar-fixed-bottom">
<div class="row" id="bottomNav">
<div class="col-xs-4 text-center"><a href="#"><i class="glyphicon glyphicon-circle-arrow-left"></i><br>Link</a>
</div>
<div class="col-xs-4 text-center"><a href="#"><i class="glyphicon glyphicon-circle-arrow-down"></i><br>Link</a>
</div>
<div class="col-xs-4 text-center"><a href="#"><i class="glyphicon glyphicon-circle-arrow-right"></i><br>Link</a>
</div>
</div>
</div>
有没有办法向上移动我的导航栏,使其位于 Android 的软导航栏上方?或者如何检查是否显示软导航栏?
感谢您的帮助...
我的 config.xml 文件中有这个值,也没有添加全屏插件,但这仍然对我有用。所以请尝试这个并让我知道这是否有效。
<preference name="permissions" value="none"/>
<!-- Customize your app and platform with the preference element. -->
<preference name="orientation" value="default" /> <!-- all: default means both landscape and portrait are enabled -->
<preference name="target-device" value="universal" /> <!-- all: possible values handset, tablet, or universal -->
<preference name="fullscreen" value="true" /> <!-- all: hides the status bar at the top of the screen -->
<preference name="webviewbounce" value="true" /> <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
<preference name="prerendered-icon" value="true" /> <!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen -->
<preference name="stay-in-webview" value="false" /> <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in -->
<preference name="ios-statusbarstyle" value="black-opaque" /> <!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar -->
<preference name="detect-data-types" value="true" /> <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
<preference name="exit-on-suspend" value="false" /> <!-- ios: if set to true, app will terminate when home button is pressed -->
<preference name="show-splash-screen-spinner" value="true" /> <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading -->
<preference name="auto-hide-splash-screen" value="true" /> <!-- ios: if set to false, the splash screen must be hidden using a JavaScript API -->
<preference name="disable-cursor" value="false" /> <!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app -->
<preference name="android-installLocation" value="auto" /> <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. -->
另请检查尝试将
toolbar=no
添加到您的 inappbrowser 链接,不确定这是否适用于 Android,但这适用于 iOS
var ref = cordova.InAppBrowser('http://apache.org', '_blank', 'toolbar=no');
将 cordova-android 升级到 12 后,我遇到了同样的问题。并通过为 config.xml 添加以下更改来修复。
<preference name="StatusBarOverlaysWebView" value="false" />
以前确实如此,因为我需要通过状态栏显示我的内容。但我已经用我的业务逻辑(javascript 文件)做到了。对我来说,现在一切都很好。希望这对其他人有帮助。