Adaptation and layout
• Adaptation creation
In general, people want to use their favorite apps on all their devices, regardless of the orientation of the device. In IOS8 and later versions, you can use dimension classes and automatic layouts to help you meet this expectation by defining the screen layout when the device placement environment changes, and how the view controller and view should be adjusted. The concept of a placement environment may involve the entire screen or just a portion of the screen, such as a pop-up menu area or a main view in a detached view controller.
iOS defines two types of dimensions: normal and compact. Regular size classes and loose spaces are linked together, and the compact size class is linked to a limited space. To describe a placement environment, you need to specify a horizontal dimension class and a vertical (vertical) dimension class. As you might guess, an iOS device can use a series of dimension classes for vertical orientation, and a different series of dimension classes for horizontal orientation.
iOS can automatically produce a variety of layout changes when the size class of a placement environment changes. For example, the navigation bar and toolbar automatically become taller when the vertical dimension class changes from compact to regular.
Your app can look great in any placement environment when you rely on size classes to navigate changes in the layout. To learn how to use dimension classes in Interface Builder, see Dimension class design guidelines. Note: In a dimension class, be sure to use automatic layout to make small adjustments to the layout, such as stretching the content or compressing the content.
The specific examples below can help you see how the dimension class describes the placement environment for different devices. For example, the ipad uses a regular size class for both length and width as well as two orientations. In other words, the ipad's placement environment is always horizontal, regular and vertical.
The placement environment for the iphone may change, depending on the device type and what orientation it is.
In a vertical placement environment, the IPone6 plus uses a compact horizontal dimension class and a compact vertical size class. In a horizontal placement environment, the IPhone6 plus uses a regular horizontal dimension class and a compact vertical size class.
All other iphone models, including IPhone6, are in the same series of size classes.
In a vertical placement environment, both Iphone6,iphone5 and iphone4s use a compact horizontal dimension class and a regular vertical size class. In a horizontal placement environment, these devices use a compact size class both horizontally and vertically.
• Provide a great experience in every environment
When you use adaptability (adaptive), you can ensure that your UI responds appropriately to changes in the placement environment. Following these guidelines brings a great experience to the user in all devices and orientations.
• Keep your focus on the main content in all environments. This is your top priority. People use your app to browse and interact with what they care about. Changing your focus when the placement environment changes will confuse users and make them feel that they have lost control of the app.
• Avoid unnecessary changes on the layout. When people rotate their devices or run your app on a different device, a similar experience in all environments allows people to maintain their usage patterns (behavioral habits). )。 For example, if you use a horizontal normal environment to display images in a grid, even though you may have to adjust the dimensions of the grid, you do not need to display the same information with a list in a horizontal, compact environment.
• Tell the user directly if your app can only run under One direction. People want to use your app in different orientation situations, which is best when you can satisfy this desire. But if your app is only important to run in one Direction, you should:
• Avoid placing UI elements that tell people to rotate the device. Running on a supported orientation clearly tells the user to rotate the device, and if necessary, do not add unnecessary decorations to the UI.
• Support for directional variants. For example, if an app can only run horizontally, people should be able to use it regardless of whether the home key is on the left or the right side of the device. And if people are using the app to rotate the device 180 degrees, if the app's content can also rotate 180 degrees to respond, it is best.
• If your app explains changes in device orientation when user input (in many forms), it handles device rotation in an app-specific way. For example, a game that lets people move content through a rotating device cannot respond to a device's rotation by rotating the screen. In situations like this, you should load all variants with the required orientation, and allow people to switch between different variants before the app's main task begins. Once people start the main task, they begin to respond to the device's movement in an app-specific way.
• Use layouts to communicate
Layouts contain more than just how UI elements are displayed in an app screen. In your layout, you show the user what's most important, what their choices are, and how things relate to each other.
• Make it easy to focus on the main task by elevating important content or functionality. A good way to achieve this is to put important things on the top half of the screen---and follow the formula from left to right---close to the left side of the screen.
• Use the impact and balance of visualizations to show users the relative importance of elements on the screen. Big things attract eyeballs and tend to look more important than small objects. Big things also make it easy for users to touch, which makes them particularly useful in some apps---such as phone and clock---users often use these apps in an easily distracting environment.
• Use alignment to simplify browsing and communicate groupings and systems. Alignment tends to make an app look neat and organized. When the user scrolls through a screen of information, alignment also gives the user space to focus on the content. Indentation and alignment of different information groupings convey how groupings are associated, and it is easier for users to find specific things.
• Ensure that the primary content is understood by the user at the default size. For example, users should not have to scroll horizontally to read important text, or to zoom in on important images.
• Prepare the change of the font size. The user wants most apps to respond appropriately when they choose a different font size in the settings. To accommodate some font size changes, you may need to change the layout. For more information about your app's display font, see "The text should always be clear."
• Avoid inconsistent appearances in your UI as much as you can. In general, elements that have the same functionality should look similar. People often think that there is a reason for the inconsistency they notice. They tend to spend time figuring out the cause.
• Make it easy for people to interact with content and controls by giving enough space for each interaction element. Give the touch control a 44x44 click Target.
(exhausted, this chapter battlefield-_-!)
IOS Human Interface Guidelines (original translation) Chapter III