简体   繁体   English

根据超级视图的整体宽度设置文本大小

[英]Setting text size according to overall width of superview

Its not really a programming question but a design implementation question but anyway im wondering how you choose the text sizes in general according to the screen size. 它实际上不是编程问题,而是设计实现问题,但是无论如何我都想知道如何根据屏幕尺寸来选择文本尺寸。 So an example is like before there was auto layout i used to say I want this views width to always be 30% of the superviews width. 因此,一个例子就像之前我曾经说过要自动布局时,我希望该视图宽度始终为超级视图宽度的30%一样。 So no matter on what screen, be it iPhone or iPad, the width of the view will always be 30% of its superview. 因此,无论在哪个屏幕上(无论是iPhone还是iPad),视图的宽度始终都是其超级视图的30%。 Now im wondering how would you choose the text size. 现在我想知道您将如何选择文本大小。 Whats the rule of thumb for choosing the text size of a UILabel if its going to not look good on an iPhone but will look good on an iPad. 如果选择UILabel的文本大小,如果在iPhone上看起来不好,在iPad上看起来很好,那凭什么经验法则呢? What i would really want from everyone is for us to talk about rules of thumbs we use specifically when hitting my current situation. 我真正想要的是让我们谈论在遇到当前情况时专门使用的经验法则。 What do you do? 你是做什么?

Ok, first of all you should read the HIG: 好的,首先您应该阅读HIG:

Now to add some value with interpretation, there's not inherently a different between iPad and iPhone. 现在,通过解释可以增加一些价值,iPad和iPhone之间并没有本质上的区别。 IF it's legible on device it should be more or less legible on another, unless you're on the cusp of being legible on the lowest DPI device - a poor decision in any case. 如果在设备上清晰易读,则在另一台设备上应该清晰易读,除非您对最低DPI设备清晰易读,这是一个糟糕的决定。

I cannot stress enough you should support and query the system accessibility fonts. 我压力不够大,您应该支持和查询系统可访问性字体。 Ie people hard of reading will choose bigger fonts sizes, all of Apple's software and system supports it. 即,难以阅读的人会选择更大的字体,Apple的所有软件和系统都支持它。

Usually in the iPad, you add more content/spaces but offer the same sizes. 通常在iPad中,您会添加更多的内容/空间,但提供相同的大小。 Buttons, as a rule can be bit bigger. 通常,按钮可以更大一些。 That will define what looks good, widen margins on the iPad a bit, which I believe is already done. 这将定义看起来不错的外观,并在iPad上扩大一点利润,我相信这已经完成了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将视图的CenterX限制为Superview的总宽度的一部分 - Constraint the CenterX of a view to be fraction of overall width of superview 根据屏幕尺寸设置UIImageView宽度 - Setting UIImageView Width According To Screen Size 如何根据超级视图调整子视图的大小和位置? - how to adjust size and location of subview according to superview? 为什么根据 superview 在 willMove(toSuperView) 方法中没有正确设置自动布局约束 - Why autolayout constraints are not setting properly in willMove(toSuperView) method according to the superview 如何在iOS中根据Superview的大小制作UIButton网格? - How to make a UIButton grid according to size of superview in iOS? UIView在VFL中相对于其超级视图的相对大小(高度/宽度) - Relative size(height / width) of UIView relative to its superview in VFL UIStackView具有比例宽度的超级视图 - UIStackView with proportional width to superview NSAttributedText字体大小根据UILabel宽度而变化 - NSAttributedText font size changes according to the UILabel width UITableView的HeaderFooterView不根据大小类的宽度拉伸 - HeaderFooterView of UITableView not stretching according to size class width 根据其父视图旋转SubView - Rotation of SubView according to it's superview
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM