搜索了高低,找不到对此的答案。简单地说,是否可以在Phonegap InAppBrowser中自定义“完成”按钮的颜色以及箭头的颜色?在iOS7上,它们似乎默认为蓝色。想使它们变白。谢谢。

最佳答案

请注意,如果您更新代码行以更改setCloseButtontitle()函数内部的“完成”按钮的颜色,并且不要在JS调用中传入closebuttoncaption参数,

没有setCloseButtontitle()的示例

ref = window.open(link, '_blank', 'location=no');


setCloseButtontitle()的示例

ref     = window.open(link, '_blank', 'location=no,closebuttoncaption=Close Window');


那么按钮的颜色不会改变,因此我建议在以下功能代码后添加代码行以更改按钮的颜色:

if (browserOptions.closebuttoncaption != nil) {
                    [self.inAppBrowserViewController  setCloseButtonTitle:browserOptions.closebuttoncaption];
 }
 //add this here so it will change the color of the button regardless of the browserOptions.closebuttoncaption being passed
 self.inAppBrowserViewController.closeButton.tintColor =[UIColor whiteColor];

关于cordova - 如何更改Phonegap InAppBrowser按钮的颜色,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19718867/

10-13 05:00