2

I'm inserting a view directly into the UIWindow of an application. If the view I was in previously had a keyboard up and was in landscape I sometimes get this view: https://i.stack.imgur.com/plutA.jpg

I have tried printing out all the details for the UIWindow's layer and all sublayers and none of them appear to have a transform on them. Any idea what could be going wrong here?

Patrick
  • 83
  • 6

2 Answers2

1

Never seen anything like that before, but keyboard orientation seems to be tied to status bar orientation so this might fix the issue

// This Controls KEYBOARD orientation even if you have the status bar hidden
//
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO]; 
John Carter
  • 2,056
  • 1
  • 17
  • 16
0

UIWindow doesn't handle auto-rotation or autoresizing - only UIViewControllers do that. You have to manage the rotation/scale of any views attached directly to the window yourself.

See Orientation in a UIView added to a UIWindow

Community
  • 1
  • 1
jsd
  • 7,673
  • 5
  • 27
  • 47