Skip to content Skip to sidebar Skip to footer

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

Solution 1:

There is not a direct equivalent of NavigationWindow for Android. But you could do something similar to this to have your app run cross platform. Also, I'm not sure if you're using Alloy or not but this is an example of how you could structure your Views to accomplish what you are trying to do with the NavigationWindow.

index.xml

<Alloy><!-- iOS --><NavigationWindowid="mainNav"platform="ios" ><Requireid="default"src="win1"></Require></NavigationWindow><!-- Android --><Requireid="default"src="win1"platform="android"></Require></Alloy>

win1.xml

<Alloy><Windowid="win1"><Label>My App Window</Label></Window></Alloy>

Solution 2:

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

Post a Comment for "Equivalent Of .ios.createnavigationwindow In Android?"