如何在iOS中与InAppBrowser插件一起使用时更改状态栏颜色?

时间:2017-10-03 22:53:12

标签: ios cordova statusbar inappbrowser

我正在尝试更改InAppBrowser状态栏颜色,默认情况下使用cordova-plugin-statusbar进行轻量级内容,但始终保持白色。如何将其更改为其他颜色?我尝试使用StatusBar.backgroundColorByHexString和StatusBar.styleBlackOpaque但没有用...

1 个答案:

答案 0 :(得分:1)

我设法自己更新了InAppBrowser插件,在CDVInAppBrowser.m上,我已经添加了这一行

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="touchslider hideslide">


<div class="touchslider-viewport">


<div class="touchslider-viewport-div">
    <div class="touchslider-item"><a href="listings/20b-woodlawn.php"><img src="slider/20b-woodlawn.jpg" class="round touchslider-viewport-div-image"  /></a></div>
    <div class="touchslider-item"><a href="listings/73-macpherson.php"><img src="slider/73-macpherson.jpg" class="round touchslider-viewport-div-image" /></a></div>
    <div class="touchslider-item"><a href="listings/232-lonsmount.php"><img src="slider/232-lonsmount.jpg" class="round touchslider-viewport-div-image" /></a></div>
    <div class="touchslider-item"><img src="slider/sign.jpg" class="round touchslider-viewport-div-image" /></div>



</div>
</div>
<script>
jQuery(function($) {
$(".touchslider").touchSlider({container: this,
duration: 800, // the speed of the sliding animation in milliseconds
delay: 5000, // initial auto-scrolling delay for each loop 
margin: 3, // borders size. The margin is set in pixels.
mouseTouch: true,
namespace: "touchslider",
next: ".touchslider-next", // jQuery object for the elements to which a "scroll forwards" action should be bound.
pagination: ".touchslider-nav-item",
currentClass: "touchslider-nav-item-current", // class name for current     pagination item.
prev: ".touchslider-prev", // jQuery object for the elements to which a     "scroll backwards" action should be bound.
autoplay: true, // Activate auto-scrolling, choose either "true" or "false"
viewport: ".touchslider-viewport"});
});
</script>

即使在InAppBrowser内部,这也会更改StatusBar的颜色,而不会通过使用StatusBar插件标志进行更改。

相关问题