Aleksey Mazurenko
Aleksey Mazurenko

Reputation: 643

Awkward Landscape keyboard in portrait mode, IOS 8

I have a portrait app that have Built-In UIViewController (portrait only) with the UIWebView that opens youtube video. Upon video playback user can rotate to landscape mode. After returning from video app correctly rotates to portrait but if user starts text editing - an awkward keyboard appears. I've tried adding landscape support to all screens - it doesn't solve the problem.

Simple steps are:

  1. UIViewController (portrait only)
  2. push UIVIewController (portrait only) with UIWebView (youtube video)
  3. start video playback, go fullscreen, rotate landscape
  4. press Done go back to first UIViewController
  5. activate textField

enter image description here

Upvotes: 3

Views: 760

Answers (1)

user5137666
user5137666

Reputation: 1

In swift:

 UIDevice.currentDevice().setValue(1, forKey: "orientation")
 UIViewController.attemptRotationToDeviceOrientation()

By using this block in view will appear you solve this issue.

Upvotes: -1

Related Questions