Manipulating the iOS status bar

4 posts, 1 answers
  1. TJ
    TJ avatar
    58 posts
    Member since:
    Aug 2013

    Posted 13 Feb 2015 Link to this post

    Hey all,

    I've been trying to manipulate the iOS status bar and have been running into issues. As a starting point I'm trying to port this Objective-C code into NativeScript:

    UIApplication* sharedApplication = [UIApplication sharedApplication];
    [sharedApplication setStatusBarHidden:YES];

    I've been able to use console.log( UIApplication.sharedApplication().statusBarStyle ) to see the current style, but UIApplication.sharedApplication().setStatusBarStyle is undefined, and I'm not sure why.

    Any help would be appreciated. Thanks,
    TJ
  2. TJ
    TJ avatar
    58 posts
    Member since:
    Aug 2013

    Posted 13 Feb 2015 in reply to TJ Link to this post

    Got this one on my own :)

    UIApplication.sharedApplication().statusBarHidden = true;

    And this in info.plist:
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>


    Just as an fyi, I found it confusing that you're expected to call “set” Objective-C methods with property access in JavaScript. I had assumed a corresponding “set” method would be present.

  3. Answer
    Pana
    Admin
    Pana avatar
    748 posts

    Posted 16 Feb 2015 Link to this post

    Hi,

    When a property is exposed in NativeScript for iOS the underlying getter and setter methods are shadowed. This is primarily for the getters usually having the same name as the properties. We are currently writing iOS specific documentation that will elaborate on the problem.

    Thank you for your interest in NativeScript. Your feedback is highly appreciated.

    Regards,
    Pana
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  4. TJ
    TJ avatar
    58 posts
    Member since:
    Aug 2013

    Posted 16 Feb 2015 in reply to Pana Link to this post

    Hi Pana,

    That makes sense. Thanks!

    TJ
Back to Top