2013-02-08 155 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/