uiinterfaceorientation

Detecting initial device orientation on iOS in Safari

末鹿安然 提交于 2019-12-07 13:22:52
问题 I know how to detect device orientation change on iOS in Safari, but I cannot fathom out how to detect initial orientation when my page loads. It is simple to detect if the device is in portrait or landscape mode - just divide window width with window height and compare result with 1. But I don't see a way to tell portrait from flipped and landscape left from landscape right. Is there a way to do it? (Why do I need it? Because accelerometer data doesn't flip together with screen when a device

Set status bar orientation in iOS 6.0 [duplicate]

北城以北 提交于 2019-12-07 06:52:13
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: setStatusBarOrientation:animated: not working in iOS 6 In iOS 6.0, as AppDelegate by default extends UIRepsonder and not UIApplication there is no global sharedApplication object. Am I missing anything? I am trying to set status bar orientation using following and it doesn't seem to work anymore. I tested it on iOS 6.0 simulator. I know you can set status bar tint color from the plist settings but can anyone

Set shouldAutorotate to false with Photolibrary

女生的网名这么多〃 提交于 2019-12-07 02:48:20
问题 If I add a popover with access to my photo gallery from the iPad the system always crash with the following message: Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [PUUIAlbumListViewController shouldAutorotate] is returning YES' But I already set up in my Projekt Information just to support Landscape Mode. So I added the following function override func shouldAutorotate()

iOS force landscape in one viewController

我是研究僧i 提交于 2019-12-06 16:07:53
Sir, I am working on the mapview module which landscape is the only orientation allowed but others for portrait only. When it comes to running on device ios 7 and 8 , the view controller is still presented as portrait orientation unless I have to manually turn the device to landscape . Would you please tell me what other steps to do ? The below is my code AppDelegate.h @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (nonatomic) BOOL isTaskPoint; @end AppDelegate.m - (BOOL)shouldAutorotateToInterfaceOrientation:

UITabBarController/UINavigationController rotation issues

女生的网名这么多〃 提交于 2019-12-06 15:31:48
My problem is the following: I want to only allow Portrait orientation on all my ViewControllers except 1 ViewController which is supposed to allow both Portrait and landscapeLeft/Right. I have now spent almost 2 days into how to set orientation in IOS for different slides/ViewControllers. After some searching I found this thread here at stack: UITabBarController Rotation Issues in ios 6 I followed Kunani's example in that thread which I will post here to save all readers some time: Zack, I ran into this same issue. It's because you have your viewController embedded inside of a TabBar

Getting wrong orientation

蹲街弑〆低调 提交于 2019-12-06 14:54:38
问题 I am having an issue in my application which drives me mad. In my application, I rotate the simulator to the landscape mode, but in my below function, I get portrait orientation. What is the problem here? Please help me out. -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if ( interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ) { NSLog(@" portrait orientation"); } else { NSLog

UIImagePickerController shows black bar when zooming – Is this a bug in iOS?

我们两清 提交于 2019-12-06 13:39:25
Edit : It has been suggested this post is a duplicate , which is not the case as the black bars are not initially present an an affine transformation does not remedy the problem. I run this on an iPad Air 2 and target iOS 8. I have a UIImagePickerController whose showsCameraControls property is set to NO . When starting the app in landscape and then zooming in, this is what happens (all images are non-cropped): A black bar appears and can be gotten rid of by changing device orientation to portrait (which will also show the black bar) and then changing it back. After change to portrait: Back to

UIWebView landscape rotation does not fill view

夙愿已清 提交于 2019-12-06 03:15:46
问题 I am having an issue with my UIWebView. When the view loads it loads in either orientation fine, fills the whole page perfectly etc. However say if I load it in portrait then rotate the device the webview does not fill all the way across to the right hand side and I cannot for the life of me figure out why. This is my view did load method - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib if ([[UIApplication sharedApplication]

Forced orientation change does not work sometimes

萝らか妹 提交于 2019-12-06 01:25:39
问题 When a certain button is pressed in my app, the view should change orientation from portrait to landscape. When the user comes back, the view controller should change back to portrait. But sometimes the orientation doesn't change or the wrong view frame is used. Here is my code -(void)btnSignClicked:(CustomSignButton *)btn { isSignButtonClicked = true; if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_0) { NSNumber *value = [NSNumber numberWithInt

supportedInterfaceOrientationsForWindow in Swift 2.0

徘徊边缘 提交于 2019-12-05 23:38:16
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask { return UIInterfaceOrientationMask.Portrait.rawValue.hashValue | UIInterfaceOrientationMask.PortraitUpsideDown.rawValue.hashValue } That used to work in Swift 1.2 however the return line is now throwing this error: Binary operator '|' cannot be applied to two 'UIInterfaceOrientationMask' operands I am able to get to work with just 1 return value with the new type but I cannot get it to pipe the second orientation I need. This 'works' func application