ios7titanium-mobiletitanium-alloyios7-statusbar

Titanium View Under iPhone Status Bar


I'm very noob in Titanium Mobile. When I create a new window the content of it goes through the iPhone Status bar (hour, signal and battery icons go on the content of my window). Is there a fast way to check if the App is run by an iPhone and set the window to start under the status bar? (I mean in alloy way).

"#mainWindow": {
    fullscreen: false,
    statusBarStyle:Titanium.UI.iPhone.StatusBar.DEFAULT 
}

I tried this but it did not work, but if I set in the previous code the property fullscreen to true the status bar disappears.


Solution

  • I suppose you want use this app at iOS 7 (title question).

    "#mainWindow": {
            fullscreen: false,
            statusBarStyle: Ti.UI.iPhone.StatusBar.DEFAULT
            width: Ti.Platform.DisplayCaps.getPlatformWidth(),
            height: (Ti.Platform.DisplayCaps.getDpi() === 320 || Ti.Platform.DisplayCaps.getDpi() === 260) ? Ti.Platform.DisplayCaps.getPlatformHeight() - 40 : Ti.Platform.DisplayCaps.getPlatformHeight() - 20,
            top: (Ti.Platform.DisplayCaps.getDpi() === 320 || Ti.Platform.DisplayCaps.getDpi() === 260) ? 40 : 20
        }
    

    The MainWindow Top or View where you add all UI Elements must have top 40 (retina) or 20.

    This is the height of StatusBar on iOS. If you want use this app at iOS version below 7.0, top is 0.