简体   繁体   中英

Why is my App always shifted to the right in the iOS Simulator?

I am building a simple iOS app using Storyboards. Currently running Xcode 7.2.1. I have previously built one using .XIB files and never had an issue with layouts on devices.

I have a UIViewController that has a UINavigationBar and Bar Button Item. When I run the app in the simulator, everything looks shifted to the right and partly off screen. The title should be shown in the centre. I am simulating using iPhone 6 and everything in Simulated Metrics are set to Inferred. Could someone help me understand, am I missing a step?

在此输入图像描述

在模拟器中查看

The views are shifted because you didn't set the auto layout constraints. To fix this, add missing constraints .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM