简体   繁体   中英

Xcode iPhone simulator acting funky

I have just begun an iPhone app tutorial. What shows up in my storyboard is starkly different to what shows up in the iPhone simulator:

这显示“ Hello World”消息在左侧

这显示在右边

One shows the "Hello World" message as being on the left

The other shows it on the right

The window is maxed out, so it's not just a viewing error. Any suggestions?

我认为您应该开始学习自动版式,然后在标签上添加一些限制

在此处输入图片说明 What you want to do is got to View > Utilities > Show the attributes inspector Under Simulated metrics change the Size (which is Inferred by default) depending from what you want..

Note: Make sure you have selected your view controller, see the image...

for dynamic approach..

Make use of your autolayout and set constraints.. at the bottom right of the storyboard click Align and set your prefered Alignment Constraints ..

I'm out here, Cheers to you sir..

The location of the label is the same if you don`t use autolayout correctly.

Select the label and add the constraint, you can play with these and auto adjust the frame.

在此处输入图片说明

Set your layout to compact width | regular height

在此处输入图片说明

Ok two things i want to tell you here !! What you see in storyboard is not what gets rendered in simulator !, the storyboard is just for your visual assistance , but if this is puzzling you , do one thing go to storyboard ->identityInspector(top right side panel) select 4th tab -> simulated Metrics ->size (click on it and find the one simulator on which you are running).

2nd thing -> if you want the frames be adjusted as per changing resolution ,you better make sure to use autolayout and set appropriate constraint .

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