Xcode Storyboard - How to Change Font Size and Position of Items Between Different iPhone Screen Sizes

So, I have the following layout in storyboards, everything works fine at 3x screen sizes, but I would like to try and remove the font sizes and position of the button icon relative to the button text.

See below what I mean. Basically, I want each screen size to look very similar to the 4.7 screen layout, for example. spacing between text and icons (also how can I get the font to shrink slightly on a 4 '' screen as it looks too big but ok on other screens.

Think about what constraints I need to put on icons and text so that they look the same on every screen size.

+3


source to share


2 answers


In auto layout, use multiplayer to enlarge and shrink the element. See example below:

Set limits as shown Set limits using a multiplier Set height multiplier Add Label Constraints Add center for patch to center set the minimum font size



Now run the app and check all types of devices. Hope this works for you.

+2


source


If you are using autolayout

, you can set constraints aspect ratio

for width

and height

for the imageView

presentation of the cell's contents, so that if the cell's image grows, it grows too.



The following link might be helpful http://candycode.io/how-to-set-up-different-auto-layout-constraints-for-different-screen-sizes/

0


source







All Articles