White status bar hide

130 views
Skip to first unread message

Рустам Муртазин

unread,
Jul 4, 2015, 5:48:12 AM7/4/15
to haxe...@googlegroups.com
Hello! How I can hide white status bar from ios devices?

In info.plist I added:

View controller-based status bar appearance=false;
Status bar is initially hidden=yes;

But it is not helpful.
screen.tiff

Alex Kolpakov

unread,
Jul 6, 2015, 6:18:35 AM7/6/15
to haxe...@googlegroups.com
Is this an OpenFL project?

If yes, this white border is most likely because the Lib.current.stage.scaleMode = StageScaleMode.NO_SCALE; setting that is default on in the older templates of FlashDevelop's OpenFL projects.

So either scale your art to fill the stage or... set the Lib.current.stage.scaleMode to a different value and risk your art to be distorted and parts of UI to appear off-screen.

Cristian Baluta

unread,
Jul 6, 2015, 12:20:36 PM7/6/15
to haxe...@googlegroups.com
Yes, doesn't look like a status bar that one, should be only 20pt

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.



--

Рустам Муртазин

unread,
Jul 6, 2015, 1:56:45 PM7/6/15
to haxe...@googlegroups.com
Yes, OpenFL project.

I tried different value to scaleMode, but result same (no depend on the orientation).

Alex Kolpakov

unread,
Jul 6, 2015, 9:30:20 PM7/6/15
to haxe...@googlegroups.com
Make a simplistic example project where you encounter this problem. Upload it to public github and give me the link ( post in this thread if you want ) and I'll commit the change that would fix that for you ;)

Cheers,
Alex.

Рустам Муртазин

unread,
Jul 7, 2015, 10:58:04 AM7/7/15
to haxe...@googlegroups.com
For example, I created a new project (openfl create project someProject)

on Main.hx  wrote:
class Main extends Sprite {


public function new() 
{
super();


var shape:Shape = new Shape();
shape.graphics.beginFill(0xff0000);
shape.graphics.drawCircle(0, 0, 300);
shape.graphics.endFill();
addChild(shape);
}
}

and tried this code:

class Main extends Sprite {
var inited:Bool;

/* ENTRY POINT */
function resize(e) 
{
if (!inited) init();
// else (resize or orientation change)
}
function init() 
{
if (inited) return;
inited = true;
var shape:Shape = new Shape();
shape.graphics.beginFill(0xff0000);
shape.graphics.drawCircle(0, 0, 300);
shape.graphics.endFill();
addChild(shape);
}

/* SETUP */

public function new() 
{
super();

var shape:Shape = new Shape();
shape.graphics.beginFill(0xff0000);
shape.graphics.drawCircle(0, 0, 300);
shape.graphics.endFill();
addChild(shape);
}

function added(e) 
{
removeEventListener(Event.ADDED_TO_STAGE, added);
stage.addEventListener(Event.RESIZE, resize);
#if ios
haxe.Timer.delay(init, 100); // iOS 6
#else
init();
#end
}
public static function main() 
{
// static entry point
Lib.current.stage.align = openfl.display.StageAlign.TOP_LEFT;
Lib.current.stage.scaleMode = openfl.display.StageScaleMode.NO_SCALE;
Lib.current.addChild(new Main());
//
}
}

But result same

вторник, 7 июля 2015 г., 4:30:20 UTC+3 пользователь Alex Kolpakov написал:

Alex Kolpakov

unread,
Jul 7, 2015, 9:08:07 PM7/7/15
to haxe...@googlegroups.com
Change your new() method to this:

public function new()
{
super();
addEventListener(Event.ADDED_TO_STAGE, added);
}

That way the resize will happen and then the init will happen.

You had the circle drawn in both new() and init() methods, but since you never triggered the added() method the init() never happened.

Best of luck with the rest of your project. May the odds be ever in your favor,
Alex.

Рустам Муртазин

unread,
Jul 8, 2015, 4:04:36 AM7/8/15
to haxe...@googlegroups.com
Thanks, Alex Kolpakov.

But...

Oh, sorry, I'm already used same code (with addEventListener(Event.ADDED_TO_STAGE, added); on function new). 

I think, that the problem is not in the source code, because if I'm added landscape and portrait Supported interface orientations in info.plist and run project, on initialize white bar not hidden, but  after rotating my device, this panel is disappeared

And sorry for mistakes on my messages, I'm russian :)

среда, 8 июля 2015 г., 4:08:07 UTC+3 пользователь Alex Kolpakov написал:

Рустам Муртазин

unread,
Jul 8, 2015, 10:15:31 AM7/8/15
to haxe...@googlegroups.com
And if minimize application and open back, this bar  appears back

среда, 8 июля 2015 г., 11:04:36 UTC+3 пользователь Рустам Муртазин написал:

Рустам Муртазин

unread,
Jul 9, 2015, 3:44:25 PM7/9/15
to haxe...@googlegroups.com
I solved this problem. Use flag -Dlegacy on compilation for fix this problem :)

среда, 8 июля 2015 г., 17:15:31 UTC+3 пользователь Рустам Муртазин написал:
Reply all
Reply to author
Forward
0 new messages