2

I am fiddling with an orientation change responsive app in Xcode and am trying to figure out how I can change that my non-black view seems to rotate on a black background on orientation change!

It looks something like this:

enter image description here

I would like to change the black background to the colour of my view - which is pink in the depicted case.

When my app launches it also shows a black screen until the actual view appears. I have the feeling that it is the same black that becomes visible on orientation change?

I have tried to change the background colour of the window in the did-finish-launching method of my app delegate, but that did not have any effect:

- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    self.window.backgroundColor = [UIColor purpleColor];

    ...
}

Any suggestions?

Stine
  • 1,605
  • 5
  • 23
  • 44
  • It looks like your question could be solved in the same manner as another StackOverflow question. Check out my answer there: http://stackoverflow.com/questions/10037924/can-i-rotate-a-uiview-without-the-black-bars/43896578#43896578 – Chris Wood May 11 '17 at 06:52

1 Answers1

0

Try using willAnimateRotationToInterfaceOrientation:duration: method instead of willRotateToInterfaceOrientation:duration:

But I think nearly all of the apps in iOS show a glimpse of black background, it seems normal. In your case if it is for long time, try reducing the duration time.

Also check this Stackoverflow Post

Community
  • 1
  • 1
Omer Waqas Khan
  • 2,423
  • 4
  • 33
  • 62
  • I am not using any of the methods as things seems to happen automatically... what am I missing here? :} – Stine Jun 04 '15 at 07:48
  • If I am not wrong, you tried giving purple color to background, but its for your app's background and not for the background of the screen, which is iOS springboard. – Omer Waqas Khan Jun 04 '15 at 07:51
  • Could you kindly elaborate on that, @Omer? :) – Stine Jun 04 '15 at 14:34