Android syntax for setRightNavButton

You must Login before you can answer or comment on any questions.

I'm trying to build an android variant of my iPhone app and I don't find any references about this :

setRightNavButton
setTitleControl
setToolBar
As those expressions are not mentioned anymore in the API ref, I wonder if they are deprecated and how can I have this working in Android

2 Answers

Accepted Answer

There is no such thing on android. They are iOs only.

http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Window-object

it says:

"titleControl view to show in the title area. only available in iPhone."

Anyway ou can fake this with your own custom view.

It's also a good idea of taking advantage of the Android menu button for this, just check Titanium.Android.Menu. It is always a good idea to check for the running plattform on application boot. You can have app.js immediately setting a plattform variable which can be accessed application wide, for example:

if(Titanium.Platform.osname==='android'){
    isAndroid=true;
}
Then you can always check on this variable to branch your platform specific code.

It is a very good practice to consistently check in all platforms as you progress, so you can spot immediately when the code needs branching.

Your Answer

Think you can help? Login to answer this question!