简体   繁体   English

appcelerator ios应用程序在应用程序内容上方和下方显示黑条

[英]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. 我无法让我的应用隐藏iphone上的状态栏。

In my tiapp.xml I have 在我的tiapp.xml中,

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

in my index.xml I have 在我的index.xml中

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

I still get a blank statusbar at the bottom of the screen on my iphone. 我的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: 您在http://s11.postimg.org/3rk17bib7/bottompart.png中看到的内容不是很清楚,因为该应用程序的背景是黑色的,但这就是发生的情况:

You were missing splash screens for the iPhone (6) you ran the app on, which triggers iOS to display the app in letterbox mode. 您缺少运行该应用程序的iPhone(6)的启动屏幕,这触发了iOS以信箱模式显示该应用程序。 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. 这很奇怪,但是与app / assets / iphone中的图像有关。 I previously deleted all the Alloy default images (all the ones starting with "Default"). 我以前删除了所有Alloy默认图像(所有以“ Default”开头的图像)。 I put the Alloy default images back and the problem disappeared. 我放回Alloy默认图像,问题消失了。

Not sure I understand why but this fixed it. 不知道我为什么会这样,但是已经解决了。

You need to do some changes in code, 您需要对代码进行一些更改,

In Tiapp.xml 在Tiapp.xml中

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

In index.xml 在index.xml中

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

In index.tss 在index.tss中

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

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

This make navbar hidden in ios. 这使导航栏隐藏在ios中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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