因此,当我点击" facebook按钮"时,应打开webview。这是一个图像,但作为一个按钮。 有没有更好的方法来做到这一点,因为这是行不通的。 使用代码似乎很容易..
var fbbutton = Ti.UI.createImageView({
image:"fb.png",
top:"55%",
zIndex:"1",
height:"15%",
width:"20%",
left:"2%"
});
fbbutton.addEventListener("click" , function(e){
var webview = Titanium.UI.createWebView({url:'http://www.facebook.com'});
var window = Titanium.UI.createWindow();
window.add(webview);
window.open();
});
答案 0 :(得分:0)
尝试明确打开窗口:
fbbutton.addEventListener("click" , function(e){
var webview = Titanium.UI.createWebView({url:'http://www.facebook.com'});
var window = Titanium.UI.createWindow();
window.add(webview);
window.open({modal:true}); // Make modal
});