autorotate

Strange behaviour rotating UIImageView inside UIView

寵の児 提交于 2019-12-11 15:34:52
问题 A lot of related questions, but I can't see any that quite match this. My app has a content view and an ad-banner view. Every time the user rotates the device, - (void) layoutSubviews gets called on the content view. My content view comprises a single image. I want this image to rotate along with the device ( it is a textured background, so I just want to rotate it 90° or 0° depending on whether the physical device is in portrait or landscape. Here is the code: // // ContentView.m //

Iphone development viewcontroller portrait to landscape no autorotate

南笙酒味 提交于 2019-12-11 14:03:05
问题 I have a viewcontroller that's pushing another vc that should be in landscape mode but it does not autorotate to landscape when pushed ie. still in portrait. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { return YES; } return NO; } When a popping the vc and back to the first controller all is perfect, it only displays

Rotating view controllers within a hierarchy of Tab Bar Controller -> Navigation Controller -> View Controller

孤街醉人 提交于 2019-12-10 17:53:12
问题 My app has a view controller hierarchy set up like this: UITabBarController | UINavigationController | | | UIViewController | UINavigationController | UIViewController All of my view controllers that are within this hierarchy override the method: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation and return YES - therefore the view controller should be able to rotate to any rotation - even upside down. However, within this setup none of the view

Android Emulator after updating to ADT 20 no longer automatically rotates screen

三世轮回 提交于 2019-12-08 03:12:16
问题 Everything was good until I updated to ADT 20 yesterday, now when I rotate screen with CTRL-F11, screen rotates, but application (ANDROID) remains in portrait mode. So my question is it possible to either solve this problem and make it rotate or downgrade to ADT 19? PS: Checked on 2.3.3 and 4.1 images, dev platform is Mac OS X 10.7.4 PPS: The only way I was able to downgrade is to look to my Time Machine backup and copy Eclipse and Platform tools folder to my Mac 回答1: I found the solution,

My self.view has the wrong dimensions

99封情书 提交于 2019-12-06 22:26:15
问题 My view has the wrong dimensions. I am running a Landscape only but the view is reporting portrait dimensions "View Width = 768.000000 Height = 1024.000000" Any Ideas how to fix that? I have played around with the autorotate I have tried - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft|| interfaceOrientation == UIInterfaceOrientationLandscapeRight); } and - (BOOL

willAnimateRotationToInterfaceOrientation not called on ios6/7

佐手、 提交于 2019-12-06 15:46:05
I have an old app, that still lives on iTunes, written in iOS 5. I would like to update it to run on ios 6 and 7. Everything has been fine so far, and I have updated my code to use ARC. However when trying to maintain the same autorotation philosophy I keep hitting a brick wall. I have already checked relative topics within SO like: Forcing landscape and autorotate in iOS 7 , Autorotate in iOS 6 has strange behaviour and following a similar topic I have found this: iOS 6 Autorotation Problems and Help which lead me to do the following: I have set the rootViewController within my AppDelegate

Autorotation, UIWebView and UITabBarController

痴心易碎 提交于 2019-12-06 13:58:41
I have the following View hierarchy: UITabBarController | UINavigationController | | | UIViewController (only supports Portrait rotation) | UINavigationController | | | UIViewController (only supports Portrait rotation) | UINavigationController | | | UIViewController (only supports Portrait rotation) | | | UIViewController (has UIWebView with movie in it) | UINavigationController | UIViewController (only supports Portrait rotation) The issue is now that when I display the UIWebView with the movie in it and the user presses "play" the fullscreen media player opens as expected. However, I am not

UIImagePickerController (using camera as source) does autorotate on iPad2, how do i stop it?

女生的网名这么多〃 提交于 2019-12-06 04:10:40
问题 I am trying to write an app with some camera function, and I use an overlay view to decorate it with an image. This is how I implement the app: I use the UIImagePickerController to who the user what the camera takes in, and add a UIImageView onto the cameraOverlayView as a subview so that it works like this: (image at http://www.manna-soft.com/test/uploads/UIImagePickerView-portrait.jpg) This works fine until the iPad2 come into place... it autorotates like this and ruin the layout: (image at

Detecting device orientation

淺唱寂寞╮ 提交于 2019-12-06 02:53:27
问题 I need to detect android device orientation change without playing manually with sensor data, while keeping activity orientation stick to some orientation onConfigurationChange will not work as will stick my activity to not rotate. Playing around with sensor data to detect the orientation change I consider that as an invention of wheel, as android already does have embedded implementation of the algorithm to detect device orientation change. And from another side the detection of orientation

iphone autorotation animation

一笑奈何 提交于 2019-12-05 12:53:13
Is it possible to turn off the animation for the autorotation? I want it to rotate, but I just dont want the animation to occur (like an instant switch). Nils Munch Just add the following code to overwrite the standard rotation animation: - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil]; } - (void)didRotate:(NSNotification *)notification { orientation = [[UIDevice currentDevice] orientation]; if(orientation == UIDeviceOrientationUnknown || orientation ==