changing the font size according to each iPhone si

2019-03-26 17:36发布

is there any way to changing/auto resizing the font size according to the different iPhone screen as when i change the font size, the font size applied to other phone size as well which is too big.

My Current Phone size is iPhone 6s plus (5.5 inch) enter image description here

enter image description here

3条回答
Luminary・发光体
2楼-- · 2019-03-26 18:09

I faced this issue few months ago. There is no way to do it on storyboard for now.

You can do it by code by detect screen size or device type and set font size for each device. You can use this lib to do that

https://github.com/sebyffffd/SDVersion

查看更多
\"骚年 ilove
3楼-- · 2019-03-26 18:12

I ran in to a similar issue. I suggest to use this library: https://github.com/hamiz-ahmed/SizeOptimizedLabel

Specify the initial screen and font size. The font gets optimized automatically according to different screen sizes.

查看更多
劳资没心,怎么记你
4楼-- · 2019-03-26 18:26

Please use size classes to support different font size for different screens. Here is good tutorial about using size classes. adaptive-layout-tutorial

查看更多
登录 后发表回答