iOS iPhone 5 Choose Correct Storyboard

后端 未结 1 1985
粉色の甜心
粉色の甜心 2021-01-14 04:16

I am attempting to use both storyboards for my iOS project, but I cannot get the code to switch to the appropriate storyboards. Instead, the code does absolutely nothing.

相关标签:
1条回答
  • 2021-01-14 04:38

    I suggest just using 1 storyboard for handling the iPhone 5 vs iPhone 3-4S screen sizes.

    When your Storyboard is open, there is a button at the bottom that toggles between the 2 sizes-- you can see in real-time how things will look.

    The button is to the left of the Zoom in % Zoom out buttons in the bottom right corner, and looks like this:

    enter image description here

    To handle how your object's frame & position will be affected by the screen size change-- you need to set the autosizing properties for each object in your view. You can do this by selecting an object, and in the right Inspector panel, Select the Size inspector like so:

    enter image description here

    You see those red lines in the Autosizing box? Play around with them to see how they will effect your object. The inner ones relate to the size (if the width, or height stretches), and the outer ones relate to the position.

    I'm not sure about your apps layout but from experience you will probably have to mess with the inner vertical line (how the height will change), and the bottom line (you want that to stay near the bottom).

    The more you mess around with each the more you will see what each does.

    0 讨论(0)
提交回复
热议问题