Search code examples
androidtitaniumtitanium-mobilenavigationwindow

Equivalent of .iOS.createNavigationWindow in Android?


I am developed an app for iOS using Titanium. Now my idea is to try to port it to android devices.

I am finding lots of errors which I am solving as I go, but I don't seem to find the solution to this one.

My app for iOS uses createNavigationWindow to navigate through the whole app. Android don't like that command as it tells me it is undefined.

I been looking for an Android version of createNavigationWindow but can't find it.

Any tip in the right direction will be really appreciated.

Titanium SDK : 3.1.3

Android: 4.4

Thanks!


Solution

  • Android does not have concept of navigational Window but it do have action Bar which only works for 3.0+ android version so you have to keep that in mind before using that.Other than that you can fake the navigation-window by adding a view to window for android 3.0-

        var win=Ti.UI.createWindow();
    
        if(Ti.Platform.osname==='android'){
        var view=Ti.UI.createView({
        backgroundColor:'black',
        height:'40dp',
        top:'0dp',
        width:Ti.UI.FILL
        })
       }
        win.add(view);
        win.open();
    

    Thanks