Twitch
unread,May 8, 2009, 3:49:37 PM5/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to phonegap
I'm probably missing something simple, but since my 4 and 2 year olds
come in every 5 minutes and order me around it's hard to concentrate.
Using the PhoneGap demo files, I was able to get the tool bar title
and the black bar at the bottom, but the bar has no buttons. I didn't
see any images in the phonegap project for these so I'm assuming it
uses default images built into the phone.
Anyone know which piece of code I'm missing that the icons wouldn't
show. I linked to the phonegap.js file and put this in my index.html
file.
function setupToolbars() {
uicontrols.createTabBar();
var toprated = 0;
uicontrols.createTabBarItem("toprated", "Top Rated",
"tabButton:TopRated", {
onSelect: function() {
navigator.notification.alert("Top Rated selected");
uicontrols.updateTabBarItem("toprated", { badge: +
+toprated });
}
});
var recents = 0;
uicontrols.createTabBarItem("recents", "Recents",
"tabButton:Recents", {
onSelect: function() {
navigator.notification.alert("Recents selected");
uicontrols.updateTabBarItem("recents", { badge: +
+recents });
}
});
var history = 0;
uicontrols.createTabBarItem("history", "History",
"tabButton:History", {
onSelect: function() {
navigator.notification.alert("History selected");
uicontrols.updateTabBarItem("history", { badge: +
+history });
}
});
var more = false;
uicontrols.createTabBarItem("more", "More", "tabButton:More", {
onSelect: function() {
if (more) {
uicontrols.showTabBarItems("search", "downloads",
"more");
} else {
uicontrols.showTabBarItems("toprated", "recents",
"history", "more");
}
uicontrols.selectTabBarItem(null);
more = !more;
}
});
try {
uicontrols.createTabBarItem("search", "Search",
"tabButton:Search");
uicontrols.createTabBarItem("downloads", "Downloads",
"tabButton:Downloads");
} catch(e) { debug.log(e) }
uicontrols.showTabBar();
uicontrols.showTabBarItems("toprated", "recents", "history",
"more");
uicontrols.setToolBarTitle("Texans Ticker");
}
function preventBehavior(e) {
e.preventDefault();
};
PhoneGap.addConstructor(function(){
document.addEventListener("touchmove", preventBehavior, false);
setupToolbars();
deviceInfo();
});
Thanks in advance,
Twitch