Can I create a standard "back" style button (a button that points left) in the navigation bar on a web view?
I need to create a back button for several pages that are really just web views. I've managed to create a working back button, but, even after a lot of time digging, can't see how to make the button the standard "back" style button.
Everyone I show the app to says "You need the back button to be the back style button".
I have to assume this is possible, but I just can't find it.
My code is pretty much exactly like the code in this tread, only it functions as a browser back button:
http://developer.appcelerator.com/question/1121/back-button-in-title-bar
// Back Button
var backBtn = Titanium.UI.createButton({
title:'Back',
style:Titanium.UI.iPhone.SystemButtonStyle.BORDERED
});
backBtn.addEventListener( 'click', function() {
webview.goBack();
});
Ti.UI.currentWindow.setLeftNavButton(backBtn);
Thanks for ANY help, as I've spent way too much time just trying to style this button. :)
Peter
5 Answers
-
Accepted Answer
http://www.keanhui.com/archives/755
Download the psd, extract the back style button, create a button and set the backgroundImage as the arrow.
-
I am having to assume that the very basic concept of a back style button in a web view is not possible in Titanium. Hard to believe, but if it's true, I may need to abandon Titanium all together…
Still hoping I'm wrong, I hope someone can help.
Thanks in advance,
Peter
-
I'm looking for the same thing, except mine is in a normal tab group navigation bar. I can't believe there aren't styles built in for forward and back arrow buttons.
-
Pretty sad that you are consider abandoning Titanium over this issue… if you want to develop web app, then do so, but if you want to develop real apps, using real OS controls and features, then why on earth are you using Titanium as a wrapper for a web app? The point of Titanium is not so that HTML developers can make iPhone apps with HTML, but so that web developers as a whole can create REAL apps on the platform using REAL platform controls and features. Looks like you only want a wrapper for webview. Perhaps a lack of programming knowledge on your part rather than a lack of features on Titanium's part.
-
Hmm seems to work with out doing some special code,
my code looks like this and works good.var win1 = Titanium.UI.createWindow({ title:'Router Commands', backgroundColor:'#fff', url:'windows/win1.js' }); //WIN1.js ---> //Creqte DAta var data = [ {title:'a', hasChild:true, test:'/ios/a.js'}, {title:'b', hasChild:true, test:'../ios/b.js'}, {title:'c', hasChild:true, test:'../ios/c.js'} ]; // create table view var tableview = Titanium.UI.createTableView({ data:data }); // create table view event listener tableview.addEventListener('click', function(e) { if (e.rowData.test) { var win = Titanium.UI.createWindow({ url:e.rowData.test, title:e.rowData.title }); Titanium.UI.currentTab.open(win,{animated:true}); } }); // add table view to the window Titanium.UI.currentWindow.add(tableview);