The display and layout are different when the iPhone viewcontroller is pushed into navigationcontroller.

Source: Internet
Author: User

In fact, this problem was discovered quite early, but I was busy with other things and did not care about it. Today, when I was writing code, I wrote a viewcontroller with imageview

When I pushed it into navigationController, I found that the image was severely deformed and I couldn't see it all.

So I had to study why. Let's take a step-by-step troubleshooting. viewcontroller was designed with ib, And I directly generated an imageview with code again,

After configuring the same image and adding it to this view, we found that the display effect was normal. It seems that it was a problem with ib design.

I searched the internet for related problems and had no results. I had to ask for help in the group. Fortunately, there were many enthusiastic people who told me that I could set the top bar and

Bottom bar,

If your viewcontroller needs to be pushed to the navigationcontroller, set the top bar to the navigation bar during design. In this way, the viewcontroller will have a navigation bar layout under ib, the design is the same as the display.

Similarly, if you add a tab bar, set the bottom bar to the tab bar, so that ib corresponds to the display.

You should pay attention to it when using ib for layout later.

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.