1
votes

Oh, I am having trouble with AutoLayout in IB(xcode 5, ios7), an IPad project.

Here is a view hierarchy in my project.

UIViewController->UIView->UITableView->UITableviewCell->UILabel。

And I add some constraints to UILable, (1.pin height, 2. Pin leading space to superview 3.pin trailing space to super view, 6 pin top space to superview.). But when I look in the portrait mode, I think it should change its' width to keep 2 and 3 constraints, but it didn't, can anyone give me a suggestion what should I do.

Thanks a lot!

Here is my screen shot in portrait mode and landscape mode.

enter image description here

enter image description here

1
Can you post a screenshot of your constraints in IB? - bilobatum
Are the table view and its cells changing their size properly when you rotate? - rdelmar
I have add screenshot and the cells seems change their size when i rotate - billwang1990

1 Answers

1
votes

I suppose I'm right when I say that you obtain the second screenshot when you select Landscape for the Orientation in the Simulated Metrics of your view controller. As the title of this section suggests, it's a simulation (might be different at run time). The warning message you have might be saying Frame for **** will be different at run time. Have you tried to run your app? Have your labels wrong positions/sizes ?