Friday, December 30, 2016

How to displays a back arrow on the home area of the action bar.

Here is the sample code. Please take a look

var win = Ti.UI.createWindow({
title : "Old Title",
navBarHidden : false
});
var actionBar;
win.addEventListener("open", function() {
if (Ti.Platform.osname === "android") {
if (!win.activity) {
Ti.API.error("Can't access action bar on a lightweight window.");
} else {
actionBar = win.activity.actionBar;
if (actionBar) {
actionBar.backgroundImage = "/bg.png";
actionBar.displayHomeAsUp = true;
actionBar.onHomeIconItemSelected = function() {
alert("Home icon clicked!");
};
}
}
}
});
win.open()


Check out this link as well 


Hope this helps.

No comments:

Post a Comment