Xcode6 above control layout in iOS, distance between two controls, percentage of controls

Source: Internet
Author: User

1. Adaptation of controls

Let the following view (green section) emulator, which requires a human constraint (constraints)

1, first make a top constraint, select View (Be sure to select the control you want to adjust)--editor--pin--top Space to Superview


2. Next, set the Contant value to 0, meaning that the view control is 0 from the top of the simulator and set to 0, and that the left side will not change, the constraint will work at compile time and will not respond in real time in development


Next, add the left constraint (leading space to Superview), the right constraint (trailling space to Superview), the bottom constraint (Bottom space to Superview), Set their contant all to 10,command+s save it.


Look at the effect, like this, the top constraint is 0, left, right, bottom constrained to 10 of a view (but we develop the panel does not change, in order to facilitate development can be manually adjusted to display, easy to develop)

2. The distance between the two controls

Quick Fit 1.2.3 steps with a detailed picture ...






















Update 2015-04-09

Click the GIF image to see the dynamic operation! 1) How is the view centered?


2) 2 views always keep a distance between them?

3) ...
Recommendation: Directly use control+ left mouse button, select a view of the Tula line to the other side of the selection, very convenient!
Summary: Just simple constraints, suitable for the screen more convenient, less write code. For how to use Storyborad (GitHub to find a simple demo, very simple) do not demonstrate, if you do not understand can Weibo contact, research study, thank you ^_^
3. Set the control to percent screen

Xcode6 above control layout in iOS, distance between two controls, percentage of controls

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.