uiinterfaceorientation

iPad orientation change issue

笑着哭i 提交于 2019-11-29 03:36:22
问题 My iPhone application is displaying some odd behavior when run on the iPad with respect to supporting orientation changes. The app starts up with a view controller (call it view A for the sake of argument) and navigation controller, and shouldAutorotateToInterfaceOrientation is returning YES for portrait only. Onto the navigation controller, I push a view controller (view B) that also returns YES for portrait only. Then, I push another view controller (view C) onto the nav controller that

How do you force an orientation change in an Android Instrumentation test?

前提是你 提交于 2019-11-29 01:54:25
问题 I'm writing some acceptance tests for an application using the ActivityInstrumentationTestCase2 class. I want to cause an orientation change from within the test to ensure that a number of things happen. Among these things are ensuring that Activity state is preserved, but also I'd like to ensure that the appropriate layout for the orientation is used. I know I can simply test the onSaveInstanceState/onRestoreInstanceState/onPause/onResume/etc. methods to make sure instance state is preserved

Two lines of text in a UISegmentedControl

痞子三分冷 提交于 2019-11-28 22:00:23
Try as I might, I can't solve a UISegmentedControl bug for an iOS7 iPhone app. When I create the segmented control, I use this code: NSArray *segmentedControlItemArray = [NSArray arrayWithObjects: @"Nominal:\n27 inch", @"Actual:\n700c x 23mm", @"Actual:\n700c x 20mm", nil]; _wheelDiameterSegmentedControl = [[UISegmentedControl alloc] initWithItems:segmentedControlItemArray]; _wheelDiameterSegmentedControl.frame = CGRectMake(0, 102, 290, 50); _wheelDiameterSegmentedControl.selectedSegmentIndex = 0; _wheelDiameterSegmentedControl.tintColor = [UIColor colorWithRed:0.35 green:0.4 blue:0.9 alpha:1

How do I detect orientation on app launch for splash screen animation on iPad!

☆樱花仙子☆ 提交于 2019-11-28 20:35:15
Hi I have an app and I have two *.pngs for default splash screen: Default-Landscape.png Default-Portrait.png What I want is to animate this default splash screen away when my app is loaded and ready to go. To achieve this I would normally present an UIImageView with either default-landscape or default-portrait (depending on the device orientation), keep it on screen for a certain time and then animate it away. My problem is that if I call [[UIDevice currentDevice] orientation] in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { The

MPMoviePlayerController re-orientation portrait to landscape and back to portrait (iOS 4.1)

六月ゝ 毕业季﹏ 提交于 2019-11-28 20:22:49
Since iOS 3.2 the MPMoviePlayerController class allows to embed a movie in the view hierarchy. Now I'm facing this issue: I create my portrait view by placing an instance of MPMoviePlayerController. When the user touch the "fullscreen" button this view enters in fullscreen mode but the view remains in portrait. When the user rotates the device the fullscreen movie view is not auto-rotated as my app forbids landscape interface orientation. So in order to allow auto-rotation of movie player fullscreen view, I changed my view controller shouldAutorotateToInterfaceOrientation: method to return YES

Status bar is Landscape, but [[UIApplication sharedApplication] statusBarOrientation] returns portrait

那年仲夏 提交于 2019-11-28 17:18:38
This problem appears to be intermittent, but I am not sure why exactly. When running my application on the device (iPad), I have some code to load a scroll view with some image views according to the current device orientation. Even though the device is landscape before loading, the views are being loaded as if it were portrait. The orientation is found by calling [[UIApplication sharedApplication] statusBarOrientation] . The views are set up to adjust their positions when the device is rotated, and indeed, rotating to portrait and then back to landscape returns them to the correct landscape

Unable to handle orientation in iOS 6?

隐身守侯 提交于 2019-11-28 17:05:14
I am using - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation delegate to change the frame of my view based on the orientation type i.e., if(UIInterfaceOrientationIsLandscape(interfaceOrientation)) { self.view.frame=CGRectMake(0,0,500,300); } else { self.view.frame=CGRectMake(0,0,300,400); } How to handle the same situation in iOS 6 as -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation has been deprecated in iOS6. I am using the following delegate to set all the orientations. -(NSUInteger

Launching into portrait-orientation from an iPhone 6 Plus home screen in landscape orientation results in wrong orientation

谁说胖子不能爱 提交于 2019-11-28 14:37:22
问题 The actual title for this question is longer than I can possibly fit: Launching an app whose root view controller only supports portrait-orientation but which otherwise supports landscape orientations on an iPhone 6 Plus while the home screen is in a landscape orientation results in a limbo state where the app's window is in a landscape orientation but the device is in a portrait orientation. In short, it looks like this: When it is supposed to look like this: Steps to Reproduce: iPhone 6

Can I rotate a UIView without the black bars?

蓝咒 提交于 2019-11-28 12:44:05
I have a UIView that takes up the entirety of the window on the iphone. When it rotates to landscape, the edges get the little black bars until it snaps into place, as i would expect. I want to make that uiview bigger than the screen, so that rotating it doesn't show those black bars but shows the parts of the view that are normally offscreen. I've tried increasing the frame and bounds of the view, but that doesn't seem to do the trick. Has anyone done this succesfully? You need to do two things to make this happen. First, the window's root view controller will always resize its view to the

MPMoviePlayerController should only in landscape mode

為{幸葍}努か 提交于 2019-11-28 09:40:35
问题 I am using the MPMoviePlayerController in my application to play videos. My application is working only in portrait mode. and I want application video should only play in landscape mode only. So please can any one suggest how i do this. Right now my video is playing in Portrait mode. 回答1: For doing this, You need to subclass the MPMoviePlayerController class. @interface yourMovie:MPMoviePlayerController { } @end and you need to implement the shouldAutoRotate method in the implementation and