When my device is locked, but in my app, I want to tap a button, my app(view controller) will rotate. Just like my device is not locked and has already set orientationMaskAll, then I rotate my device, the view controller rotate?
I want to make a custom movie player. when MPMoviePlayerController view addsubview in a containView, when I tap a button, the device rotate, and the MPMoviePlayerController view enter fullscreen!
Related
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:
UIViewController (portrait only)
push UIVIewController (portrait
only) with UIWebView (youtube video)
start video playback, go fullscreen, rotate landscape
press Done go back to first UIViewController
activate textField
In swift:
UIDevice.currentDevice().setValue(1, forKey: "orientation")
UIViewController.attemptRotationToDeviceOrientation()
By using this block in view will appear you solve this issue.
My app is iPhone-only but can be viewed on iPad using the 1x/2x-mode. The following behavior appears only on iPad. When I start a html5-video from the UIWebView it is automatically shown in the native movie player. When I quit the player the web view is visible again but now with a black area - like a bar - on top of the view so it looks as if the view was cropped. It is like a black overlay with the width of the web view (which indeed takes the whole screen). How do I get rid of this thing and what is the purpose of it anyway?
UPDATE:
It seems to have something to do with a "rotation frame". The main view is for portrait mode only - rotation is prohibited, but the native movie player allows landscape mode.So when I watch the video in landscape mode and tap on "done" I can see the "bar" rotate. (As documented in screenshot.)
I have an app which I want to be in portrait only mode for most of it, but when it plays videos, I want the MPMoviePlayerViewController to force itself into landscape. Then, when the video is dismissed or ended, I want the app to go back to being in portrait. I'm presenting an MPMoviePlayerViewController using the -presentMoviePlayerViewControllerAnimated: method.
I am currently writing an iOS app in which have the acceptable device orientations set to Landscape Right and Landscape Left, and in all of my view controllers, I’m returning only those two in the supportedInterfaceOrientations method.
However, if the user uses the in-app camera functionality (which is implemented via UIImagePickerController presented modally in full screen) and rotates the device to Portrait orientation to take a picture, the camera rotates to portrait mode (which is fine), and if the user clicks "Use Photo", when the modal view is dismissed, the view from which the camera was launched is somehow now in portrait mode (which is not fine).
After the camera view has been dismissed, the view controller from which it was launched has UIDeviceOrientationIsPortrait set to true. I am wondering how it ended up in this orientation, and how when a picture is taken, I can ensure that the presenting view controller remains in a landscape orientation. Any help is greatly appreciated!
I am currently writing an iOS app in which have the acceptable device
orientations set to Landscape Right and Landscape Left, and in all of
my view controllers, I’m returning only those two in the
supportedInterfaceOrientations method.
In iOS 6 and later, your app supports the interface orientations defined in your app’s Info.plist file
Have you tried setting it here? Then see if the problem still occurs.
Also, if this doesn't work, try setting the supportedInterfaceOrientations values in the viewWillAppear method of the ViewController that launched UIImagePicker?
My app opens in portrait. When your turn to lanscape, a second landscape view appears. I want the user to be able to lock the screen in this position so turning the device to potrait does not change the view back to the first view unless they unlock it.