This is a migrated thread and some comments may be shown as answers.

Manipulating the iOS status bar

3 Answers 64 Views
NativeScript Insiders
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
TJ
Top achievements
Rank 1
TJ asked on 13 Feb 2015, 09:25 PM
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

3 Answers, 1 is accepted

Sort by
0
TJ
Top achievements
Rank 1
answered on 13 Feb 2015, 10:29 PM
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.

0
Accepted
Pana
Telerik team
answered on 16 Feb 2015, 03:35 PM
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.

 
0
TJ
Top achievements
Rank 1
answered on 16 Feb 2015, 04:40 PM
Hi Pana,

That makes sense. Thanks!

TJ
Tags
NativeScript Insiders
Asked by
TJ
Top achievements
Rank 1
Answers by
TJ
Top achievements
Rank 1
Pana
Telerik team
Share this question
or