Research on horizontal screen mode of iPad and Screen mode of iPad

Source: Internet
Author: User
Tags notification center

Research on horizontal screen mode of iPad and Screen mode of iPad

How to enable devices to only support the landscape mode during iPad application development? I tried multiple times and did not find a simple setup method. I tried about three methods.
1. Set "iPad Deployment info" Through XCode, and select only the left and right sides of the landscape screen. The Deployment test does not take effect, in essence, this method adds the following information to the xxx_info.plist project configuration file:
<Key> UISupportedInterfaceOrientations ~ Ipad </key>
<Array>
<String> UIInterfaceOrientationLandscapeLeft </string>
<String> UIInterfaceOrientationLandscapeRight </string>
</Array>
2. This method does not take effect either by setting orientation to landscape for each nib file in IB.
3. Reload shouldAutorotateToInterfaceOrientation: This method is feasible. The details are as follows:
-(BOOL) shouldAutorotateToInterfaceOrientation :( UIInterfaceOrientation) interfaceOrientation
{
// Return YES for supported orientations
Return (interfaceOrientation = UIDeviceOrientationLandscapeLeft) | (interfaceOrientation = UIDeviceOrientationLandscapeRight ));
}
If the first method takes effect, it is perfect. Although the third method can fully meet the needs of the landscape screen, but it is more stupid to achieve, You need to reload shouldAutorotateToInterfaceOrientation in each controller: method, of course, you can also avoid repetitive work by extending UIViewController. However, it seems a little too straightforward. It is expected that someone will point out whether the sdk itself has simple support.

There are many ways to create two la s for the iPad UI layout: Landscape screen and landscape screen. However, when switching the UI, You have to determine which layout to display, I recorded one of the methods I used, which is convenient:
Nsicationicationcenter * nc = [NSNotificationCenter defacenter center]; // Get the notification center for the app
[Nc addObserver: self // Add yourself as an observer
Selector: @ selector (orientationChanged)
Name: UIDeviceOrientationDidChangeNotification
Object: nil]; // This function is used to obtain the direction of the current device,
-(Void) orientationChanged
{
// UIView * ftView = [self. view viewWithTag: 200];
If ([[UIDevice currentDevice] orientation] = UIDeviceOrientationLandscapeLeft | [[UIDevice currentDevice] orientation] = UIDeviceOrientationLandscapeRight) // judge left and right
{
// New layout of the interface
}
If ([[UIDevice currentDevice] orientation] = UIInterfaceOrientationPortrait) // I have a direction that is not supported. if you want to support it all, you can skip this if condition.
{
// New layout of the interface
}
}

IOS 5 has been tested on a real machine. It's very convenient. I can see it later. I will not talk about it here!


Why is it better to experience the ipad QQ space this afternoon? Is it being upgraded in Landscape mode?

Well, I also have the above problems. Hope Solution
 
Horizontal screen of ipad

First, the ipad has a horizontal screen, but the interface is not particularly suitable, because the pop-up virtual keyboard occupies nine of the 10 screens (it is a very horizontal screen anyway) and can only be abandoned; however, if you only answer this question, the answer is meaningless. We recommend that you use the horizontal screen of the ipad to avoid popping up the area occupied by the virtual keyboard:
First, buy a Bluetooth External keyboard, and do not connect (not a blue friend, but a Bluetooth keyboard yo) → 2. unlock screen rotation lock → 3. enter, horizontal screen (at this time, the effect of a Special Horizontal screen is too crude !) → 4. Now you can turn on Bluetooth, connect to the keyboard, collapse the virtual keyboard, and OK. Now you can chat on a horizontal screen without the influence of a large pop-up virtual keyboard!
But !!! The next step is to focus on cutting-edge technologies. You should consider the following restrictions:
You need an external Bluetooth keyboard (hello! Isn't that nonsense !);
The screen is connected to the keyboard first, and the sequence cannot be messy (the gender, the father, and the son cannot be chaotic );
You can rotate only when you click Open to the dialog interface with a person, and then rotate to the right (I personally think this is the key to finishing this article! # Serious face #);
The horizontal screen status can only stay on the current user's interface. If you want to return the screen to someone else, you have to have a portrait screen (if you want to landscape screen again, you have to turn off the Bluetooth, right-handed and then left-handed again !) Of course, I am not bothered to use it to chat with the aluminum basin friends ~ (@ ^ _ ^ @)~
So, do you think I am here to share my experience with you? Then you are too Yang Mi (young me, look at me, it's not a bad joke !) My real goal is only one sentence, that is, how is it blue when you develop a HD!

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.