Click button and open hyperlink in SAFARI instead of webview
Is it possible to push a button and open safari with the hyperlink ?
I do it now with a webview and it works but when I enlarge the characters it is not very good readable.
var b1 = Titanium.UI.createButton({
title:'www.soft4u.be',
height:40,
width:130,
left: 20,
top:320
});
var visible=true;
b1.addEventListener('click', function()
{
var w = Ti.UI.createWindow();
w.orientationModes = [
Titanium.UI.PORTRAIT,
Titanium.UI.LANDSCAPE_LEFT,
Titanium.UI.LANDSCAPE_RIGHT
];
var webview = Ti.UI.createWebView();
webview.url = 'http://www.soft4u.be';
// webview.scalesPageToFit = true;
w.add(webview);
win.tab.open(w);
});
win.add(b1);
1 Answer
-
Accepted Answer
you'll want to use Titanium.Platform.openURL()
so…
//create label (or button etc) var label = Ti.UI.createLabel({text:'LINK'}); //event listener label.addEventListener('click', function(e) { //open link in safari - application will close Titanium.Platform.openURL('http://www.soft4u.be'); });