changing the font size according to each iPhone size

半腔热情 提交于 2019-12-12 07:57:11

问题


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)


回答1:


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




回答2:


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.




回答3:


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/sebyddd/SDVersion



来源:https://stackoverflow.com/questions/39523476/changing-the-font-size-according-to-each-iphone-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!