简体   繁体   中英

appcelerator ios app displays black bar above and below app content

This is driving me completely crazy. I can not get my app to hide the status bar on my iphone.

In my tiapp.xml I have

<fullscreen>true</fullscreen>
and
<key>UIStatusBarHidden</key><true/>

in my index.xml I have

<Alloy>
<Window class="container" fullscreen="true">

I still get a blank statusbar at the bottom of the screen on my iphone.

What do I miss ? This is frustrating.

What you saw in http://s11.postimg.org/3rk17bib7/bottompart.png is not very clear because the app had a black background, but this is what was happening:

You were missing splash screens for the iPhone (6) you ran the app on, which triggers iOS to display the app in letterbox mode. So the black space under the label is the letterbox. Same will have been visible at the top of the screen.

Finally found the problem. It's pretty strange but it has to do with the images in app/assets/iphone. I previously deleted all the Alloy default images (all the ones starting with "Default"). I put the Alloy default images back and the problem disappeared.

Not sure I understand why but this fixed it.

You need to do some changes in code,

In Tiapp.xml

<fullscreen>false</fullscreen>
<navbar-hidden>true</navbar-hidden>

In index.xml

<Window class="container">
    <Label id="label" onClick="doClick">Hello, World</Label>
</Window>

In index.tss

".container": {
   layout: "vertical",
   navBarHidden: true,
   backgroundColor:"white"
}

http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Window-property-navBarHidden

This make navbar hidden in ios.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM