Skip to content

Instantly share code, notes, and snippets.

@kosso
Last active April 24, 2017 07:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kosso/32931182c4a707d42572fc7ab35de501 to your computer and use it in GitHub Desktop.
Save kosso/32931182c4a707d42572fc7ab35de501 to your computer and use it in GitHub Desktop.
// Creates our main root window. Fullscreen all the way!
var win = require('/ui/common/window_home').createWindow();
if(Ti.Platform.osname==='android'){
// This Theme makes sure the windows are full screen and buttons aren't always in caps.
// mytheme.xml lives in /platform/android/res/values - see below.
win.open({theme: "MyAmazingTheme"});
} else {
var rootNavWin = Titanium.UI.iOS.createNavigationWindow({
zIndex:1,
window: win
});
win.containingNav = rootNavWin;
// Always add the parent window as the containingNav param to open a new subsequent window.
rootNavWin.open();
}
/**
mytheme.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- this is our main root window for android. fullscreen. no bars. -->
<style name="Theme.NoActionBar" parent="@style/Theme.AppCompat">
<item name="windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:textAllCaps">false</item>
</style>
<style name="MyAmazingTheme" parent="@style/Theme.AppCompat.Fullscreen">
<item name="android:textAllCaps">false</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment