I use an HDMI cable to display my iPad screen on a TV. if I save the iPad in landscape mode, the output on the TV screen in landscape mode. and if I turn it to portrait output on the TV, then to portrait mode.
Is there a way to limit this, even if I rotate the iPad to portrait orientation, the TV output should remain in Landscape
Here are some images that will clearly state my question
this is my orientation on the iPad ...

This is what I get .........

This is what I want ......
OR 
I went so far from messing with programming.
I made a button over a UIImageView with some image, in one application template of the Xcode view with the IBaction method, this method has the following code
- (IBAction)screenButton:(id)sender { NSLog(@"Screen Count %d",[[UIScreen screens]count]); if([[UIScreen screens]count] > 1) { CGSize max; UIScreenMode *maxScreenMode; for(int i = 0; i < [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++) { UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i]; if(current.size.width > max.width) { max = current.size; maxScreenMode = current; } }
To some extent, I could solve my problem, but the problem I encountered is as follows
whenever I launch the application and save it in portrait mode, the output to the TV is an exact copy of my iPad screen.
now when i click the UIButton to which i have assigned the code above. UIAlertView is displayed on the iPad screen (but not on the TV screen). and the orientation on the TV screen changes to "Landscape" with my iPad in the "Portrait" mode (in fact, this is exactly what I really wanted) ....
but when I click the UIalertView cancel button to close the warning window. the orientation at the TV output changes to portrait mode again ....
Is there a way to prevent what happens in my case when a UIAlertView appears. this would solve the problem.
ios objective-c ipad uiscreen uialertview
Dev_dash
source share