inspiration
inspiration

Reputation: 174

Why does View Controller Shift in Storyboard on Button Segue

I am new to IOS App development and have a question. I'm trying to segue from one view controller to another. However, it seems that every time I ctrl+drag from the options button to the adjacent view controller and choose the 'show' option, the view controller "shifts" down(bottom picture). Why does that happen and if it is not the correct behavior, how can I do it right? Thanks!

Before

After

Upvotes: 0

Views: 745

Answers (3)

Nayan Dave
Nayan Dave

Reputation: 1680

If you're new to iOS

then I might suggest don't use show and don't use segue from storyboard

If you don't know the concept of navigation controller (push and pop methods), then have a look at it (You may not use show afterwards)

have a look at following link

Swift programmatically navigate to another view controller/scene

Upvotes: 1

Govind Ravaliya
Govind Ravaliya

Reputation: 73

You need to set fullscreen style manually if select model style, a fullscreen option did not show in Push type, you must use Navigation Controller if you want to set fullscreen for Push https://i.sstatic.net/rg20Y.png

Upvotes: 3

Keshu R.
Keshu R.

Reputation: 5223

When you click on the segue(the line that connects view controllers) and open the Attribute Inspector in right panel, you will see the Kind is set to Present Modally. This means your view controller will popup on your current screen.

You can change the Kind to Push and it will start showing normally.

Also embed your controller in a navigation Controller

Option 2

If you dont want a navigation controller, you can also change the presentation to full screen.

enter image description here

Upvotes: 2

Related Questions