2013-02-08 149 views
2

有没有一种方法来设置或至少在新的浏览器窗口中设置所需的按钮?新科尔多瓦InAppBrowser按钮

我知道我可以用ChildBrowser插件来做到这一点,并且它可以和新的Cordova一起生活 - 但我们想尝试新的InAppBrowser作为标准。

感谢

+0

您正在使用什么平台? –

+0

好点。我们现在在iOS上使用它。 –

回答

1

我已经打了一下它,我可以通过复制CDVInAppBrowser.m文件中的关闭按钮的代码添加一个新的按钮。然后,我通过shareButton更名closeButton,并通过一个新的函数的函数回调wnShare这样的:

self.shareButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(wnShare)]; 
self.shareButton.enabled = YES; 
self.shareButton.imageInsets = UIEdgeInsetsZero; 
self.shareButton.style = UIBarButtonItemStylePlain; 
self.shareButton.width = 38.000; 

然后你就可以添加你想要通过将代码添加到新的函数来执行按钮被点击时的动作:

- (void)wnShare 
{ 
    /* Whatever ou want to do when the button is tapped goes here */ 
} 

现在我正在寻找关于如何打开一个对话框并显示很多共享链接共享通过不同的社交媒体当前显示的网站。 如果你有一些线索,请告诉:-)

我写修改的完整列表,进入我的博客,如果有人需要的是: http://blog.cubeinspire.com/how-to-add-a-new-event-type-into-cordova-2-4-0-phonegap-2-4-0-to-the-plugin-inappbrowser/