Get started with iOS FAQs--ios Simulator display dislocation problem solving

Source: Internet
Author: User

Since we have just started to learn iOS, there are a lot of problems that you will encounter, and it may be a problem for everyone. I will also be in their own learning process encountered problems and solutions written to share with you. This blog to solve the problem is the iOS simulator display and Main.storyboard in the layout of inconsistent or wrong.

(1) Create a new iOS application project and select Single View application on the right. Click Next, the project name is any, the following devices select iphone and then create the success.

(2) Then in the Main.storyboard of the interface design, we drag several space to the horizontal center position. :


(3) Then click Run, Simulator select iphone5s, run Result:


(4) Analysis of the results, found that the original design in the central control all ran to the right or even escaped the border. Completely inconsistent with the expectations. We need to find a way out.


(5) This is the most common problem for us novices. This is caused by our use of automatic layout. The solution is to find "use Auto Layout" and "Use Size Classes" on the right, and cancel both options. Cancellation may be prompted, the next step is possible.



(6) We can then find that our main.storyboard has changed and become the iphone interface, which is displayed in the same interface as the one we just showed in the simulator. Finding this problem is not a problem with the simulator, it's just the layout that we did when we designed it.


(7) Re-drag the space in the Main.storyboard to the horizontal center position, and then display the following in the simulator. The discovery control already appears where we expect it to be. The simulator is displayed correctly and the problem is resolved successfully.


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Get started with iOS FAQs--ios Simulator display dislocation problem solving

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.