sri_84
sri_84

Reputation: 91

Second scene view controller constraints issue

I am working on an iOS project when I ran into this problem. When I add second scene view controller and add buttons in it, the buttons don't show up on the simulator in correct place. It is stuck up at the topmost left corner, I am not able to move it down. I tried applying constraints but they are not taking effect. Can someone please guide me? Attaching screenshots of storyboard and simulator

Storyboard with size inspector

iOS Simulator with the button

Upvotes: 0

Views: 96

Answers (4)

sri_84
sri_84

Reputation: 91

Thanks guys for those wonderful answers. I was able to get around this issue yesterday, it is because of device orientation setting, the simulator was running in landscape mode setting, when I changed it to Portrait mode it started working. There is a setting available in bottom part of the view controller which sets the view options for different devices, I had accidentally set it to "wCompact hCompact", this setting will default the image to landscape image of storyboard on simulator. In the simulator though I was viewing it in Portrait mode. Attaching the screenshot with this setting.

Storyboard with view option

Upvotes: 0

Jay
Jay

Reputation: 5

You Have to deselect the auto layout from the right side button menu.

Upvotes: 0

Omarj
Omarj

Reputation: 1159

You have the choice to Update Your Frame or update your Constraints

enter image description here

enter image description here

enter image description here

Upvotes: 1

Schemetrical
Schemetrical

Reputation: 5536

You need to delete and remake new constraints. Right now your constraints are reflected in what is happening when you actually run the app, but when you move the view around in the storyboard, the constraints won't automatically update.

Click on each individual constraint and delete it before you create new constraints with different constants.

Upvotes: 0

Related Questions