x


iOS Notification Center Orientation

I have a full screen game where objects spawn from the top of the screen (when holding it landscape, not portrait), however the notification center tab sometimes blocks the view. I believe you can't actually completely disable notification center, but is there a way to move the tab? So that way it appears on the left side of the screen when in landscape view?

I believe being able to move the status bar orientation could solve the issue, but I only know how to do that with obj-C, not anything Unity uses.

Thanks!

more ▼

asked Nov 28, 2012 at 12:32 AM

KamiKaze425 gravatar image

KamiKaze425
3 10 9 11

I'm trying to use the Obj-C code: "[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationPortrait;"

but I can't seem to find a good place to put it. I was going through the .mm files in XCode, but none of the locations I've tried seem to apply

Nov 29, 2012 at 08:05 PM KamiKaze425
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

After testing a bunch of stuff, I finally figured it out. You need to disable Auto-rotation (which kind of sucks, but doesn't really affect gameplay)

Then in "IPhone_View.mm", in method orientTo, replace

[UIApplication sharedApplication].statusBarOrientation = ConvertToIosScreenOrientation(requestedOrient);

with

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
more ▼

answered Nov 30, 2012 at 12:56 AM

KamiKaze425 gravatar image

KamiKaze425
3 10 9 11

if you use something that puts the game temporarily in the background (like logging into facebook), an alternate, and probably more universal solution would be to add "[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];" to the "AppController.mm" class under the method "applicationDidBecomeActive"

Nov 30, 2012 at 12:16 AM KamiKaze425
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2782
x194
x9
x2

asked: Nov 28, 2012 at 12:32 AM

Seen: 975 times

Last Updated: Nov 30, 2012 at 12:56 AM