Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Tagged

How to hide [iOS 7] status bar? (FULLSCREEN not working)
  • MoNuSMoNuS
    Posts: 34

    Hi, I just realized that even though I specify displayMode(FULLSCREEN_NO_BUTTONS) in my main file, the exported XCode App still shows the status bar (carrier, current time, and battery). Is there a way to get rid of this? Thanks!

  • MoNuSMoNuS
    Posts: 34

    Nobody has the same issue?

  • dave1707dave1707
    Posts: 2,553

    @MoNuS It's possible that others have the same problem, they just don't have a solution. Since I don't export anything, I don't have a solution, but I also don't have the problem.

  • MoNuSMoNuS
    Posts: 34

    Thank you very much, @dave1707. This is a strange issue... I have not had this problem before. I do not see this happening on the App Store version of Cargo Bot so I guess I must be doing something wrong, I just cannot figure it out :)

  • SkyTheCoderSkyTheCoder
    Posts: 1,354

    I think you'd have to use Objective C. FULLSCREEN_NO_BUTTONS only removes Codea buttons, such as pause, screenshot, and record.

    Anyways, I would highly recommend waiting for Codea to update, as current exports, I believe, don't use all the iOS 7 things, and are all optimized for iOS 6.

  • MoNuSMoNuS
    Posts: 34

    Thanks @SkyTheCoder! I guess that that might be what they do in Cargo Bot then... Do you have any idea on when the next release will be available? Thanks again!

  • SkyTheCoderSkyTheCoder
    Posts: 1,354

    @MoNuS Well, you can see TLL has been busy, check their development twitter... I'm not sure exactly when, but I'm pretty sure soon.

  • I also see the status bar when you export to Xcode and port it over to an iPad. I would love to find a way to get true full screen, no status bar when exported.

  • SkyTheCoderSkyTheCoder
    Posts: 1,354

    It might be fixed when Codea updates to iOS 7.

    If it was intended, it's probably an easy fix in Objective C.

  • JohnJohn
    Posts: 306

    @MoNus

    Until we get out an updated Runtime try the following:

    In XCode open RuntimeViewController.mm and add the following method inside the implementation block

    - (BOOL)prefersStatusBarHidden
    {
        return YES;
    }
    

    I haven't tested this on that particular version of the runtime but I think it should work on iOS 7. The other thing you can do it use the 6.1 Base SDK inside XCode 5 but you need to extract that from XCode 4.6 which is a little tricky.

  • MoNuSMoNuS
    Posts: 34

    Dear @John, thank you very much for your response. Is the file RuntimeViewController.mm to be found inside the exported project? I could not find it. Sorry to keep bugging about this, and thanks a million for your help!

  • ZoytZoyt
    Posts: 2,703

    @MoNuS - While @John's method works fine, I fond that putting the following code in my info.plist file did the trick for me:

    <key>UIStatusBarHidden</key>
    <true/>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    

    Sorry I didn't check this thread earlier. I assumed it was already fixed.
    Thanks!

  • ZoytZoyt
    Posts: 2,703

    @John - Did you mean "AppDelegate.mm"? I don't know about the open source version, but in our version we only have "CodeaViewController.h".
    @MoNuS - You're not going crazy.

  • JohnJohn
    Posts: 306

    Good point @Zoyt, I forgot that the runtime only includes a static library. This can still be achieved via a category on the class but your method should work fine too.

  • MoNuSMoNuS
    Posts: 34

    Awesome @Zoyt! Finally got it working, 2:23AM Atlanta time :) Thanks so much!

  • I placed the "- (BOOL)prefersStatusBarHidden" in my AppDelegate.mm:

    //
    //  AppDelegate.mm
    //  Lesson4
    //
    //  Created by Patrick Coxall on Thursday, October 24, 2013
    //  Copyright (c) Patrick Coxall. All rights reserved.
    //
    
    #import "AppDelegate.h"
    #import "CodeaViewController.h"
    
    @implementation AppDelegate
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        self.viewController = [[CodeaViewController alloc] init];
    
        NSString* projectPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Lesson4.codea"];
    
        [self.viewController loadProjectAtPath:projectPath];
    
        self.window.rootViewController = self.viewController;
        [self.window makeKeyAndVisible];
    
        return YES;
    }
    
    - (BOOL)prefersStatusBarHidden
    {
        return YES;
    }
    

    The status bar is gone on the simulator but not on my iPad. @Zoyt!, could you share what exactly you did to make it vanish? Thanks

  • I also got it!

    There is an info.plist and in my case a Lesson4-Info.plist (where Lesson4 is the name I gave the project it Codea). If you add:

    <key>UIStatusBarHidden</key>
    <true/>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    

    to the Lesson4-Info.plist, then the status bar goes way.

    Thanks, Patrick

  • MarkMark
    Posts: 1,042

    Dang it. I've made the changes to both my plist and my AppDelegate.mm, and while the simulator looks fine, an actual iPod touch running iOS 7 still shows the default status bar.

    Ahhh, got it. The keys go in projectname-info.plist, not your info.plist inside the project folder (just in case this confused anyone but me).

  • MajormorganMajormorgan
    Posts: 89

    @Mark, did you do John's code for the keys only? If so how did you put it into the projectname-info.plist?

    Thanks, Major

  • MajormorganMajormorgan
    Posts: 89

    Fixed it. Its an io7 issue that requires another workaround

  • MajormorganMajormorgan
    Posts: 89

    is the link