Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
How Do You Add Status Bar To App? — Gideros Forum

How Do You Add Status Bar To App?

ljp1203ljp1203 Member
edited October 2012 in General questions
Hi all!

I need to know how to add an iOS status bar to my app so it displays the time and other things it shows.

Thanks!
-Landon
JLS
Lead Coder and Designer

Comments

  • SimpleLoopSimpleLoop Member
    Accepted Answer
    There are a few ways to achieve this
    1. Add the BhWax plugin from bowerandy and work out how to do it in that.

    2. Add the UIKit Plugin found here https://github.com/carolight/MHUIKit and in your code include

    require "ui"
    hideStatusBar(false)

    3. Draw a custom one using lua functions.
  • bowerandybowerandy Guru
    edited October 2012 Accepted Answer
    @ljp1203, using BhWax it's easy. Just add the following line to your main.lua:
    UIApplication:sharedApplication():setStatusBarHidden_animated(false, false)
    What I did was type "iOS status bar" into Google. Then look for something on StackOverflow (there's tons of good stuff there). The first result was:

    http://stackoverflow.com/questions/3542350/ios-sdk-how-to-get-the-status-bar-back-when-using-uiimagepickercontroller

    This seemed good enough, and the first reply says what ObjectiveC is required. The only thing left is to convert this into a wax call. I provide a tutorial on how this can be done here.

    best regards
  • Hi! @bowerandy @SimpleLoop

    Thanks for the replies!

    Now I have another question. I have developed my app to the point of where I will start to need Plugins such as Wax or UIKit. How would I implement these into my existing project? Do I have to export the project?

    If you can, can you give me step by step directions because I am still new to the Plugins part of Gideros :)

    Thanks!
    -Landon
    JLS
    Lead Coder and Designer
  • OZAppsOZApps Guru
    Accepted Answer
    @Landon, if you read the article from @Andy on his site (I have the link on my articles too) the bhWax project is complete with instructions on how to integrate. If you want to create the final project, not the player, you follow the same instructions but add the files to the your exported project from Gideros instead of adding them to the Gideros player project.

    I take it that you are able to test the bhWax plug-in on your device or the simulator, so you know how to set it up.
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Hi! @OZApps @bowerandy @SimpleLoop

    Thanks for the response @OZApps !

    I have another question, once you add the files to your exported Gideros Project, how can you edit the LUA files, because Xcode won't let me edit them.

    Thanks!
    -Landon
    JLS
    Lead Coder and Designer
  • bowerandybowerandy Guru
    edited October 2012
    @ljp1203, you don't edit them in Xcode. You go back to Gideros Studio, make your changes in there and re-export. If you click the "Export Assets Only" check box then it won't overwrite anything else in your project, just the Lua and graphics assets.

    Normally, you would only export your project when you are just about to release it. When developing and debugging, use the Gideros player (built with the necessary plugins in it) running on the device.

    best regards

    Likes: atilim

    +1 -1 (+1 / -0 )Share on Facebook
  • atilimatilim Maintainer
    To show the status bar, you can also find this line:
    self.viewController.wantsFullScreenLayout = YES;
    at AppDelegate.m and delete it.
  • Instructions for adding UIKit Plugin
    It looks like a lot but is not so complicated

    First you will need to download the UIKit Plugin
    1. Goto https://github.com/carolight/MHUIKit and click the zip button.
    2. Unzip the downloaded file.
    3. Go into the Plugin folder in the unzipped folder.
    4. You will need the uikit.mm file later so leave this folder open for now.

    Now we need to get the player ready for the plugin.
    1. Locate and unzip GiderosiOSPlayer.zip in the Gideros Studio folder.
    2. Go into the folder you just unzipped
    3. Go into GiderosiOSPlayer folder in that folder
    4. Go into plugins folder
    5. Copy uikit.mm into there

    Now to add it to the player project.
    1. Go back to the unzipped GiderosiOSPlayer folder
    2. Open GiderosiOSPlayer.xcodeproj in XCode
    3. Expand the Plugins folder in the navigation bar on the left.
    4. Drag uikit.mm into that folder
    5. Deselect Copy items into destination group's folder (if needed) as we already copied it into this folder in step 5 of the previous section.
    6. Click finish

    The UIKit should now be added to the player app.
    You may also need to add the red .h files that are in the plugins folder if errors occur.
    Now run the GiderosiOSPlayer project, either in the simulator or on a device.
    It will open like the gideros player does but in the iOS Simulator or on your device.

    Now in Gideros Studio in your project just add

    require "ui"
    hideStatusBar(false)

    If it is on the Simulator you should be able to in Gideros Studio just press run.
    If it is on your device in Gideros Studio Go into the player menu and choose player settings. Untick localhost and then type in the IP address shown on your device, click ok and press play.

    When building your project export it using Gideros Studio then follow the same steps but using the project that was exported instead of the GiderosiOSPlayer project.

    If anyone spots any errors in these instructions or there are any questions feel free to say.
  • ljp1203ljp1203 Member
    edited October 2012
    Hi @bowerandy @OZApps @SimpleLoop

    Thanks for the response. Now I'm having yet another issue. I followed your video tutorial video exactly. But every time I try to run my GiderosIOSPlayer, it says I have a sematic issue and it won't let me run and it says build failed. I've attached a screenshot of what is happening and hopefully you can help me!

    Thanks!
    -Landon
    Screen Shot 2012-10-19 at 10.14.51 PM.png
    1394 x 818 - 392K
    JLS
    Lead Coder and Designer
Sign In or Register to comment.