NSLabel自动收缩具有最高限制 [英] NSLabel Autoshrink with top constraints

查看:105
本文介绍了NSLabel自动收缩具有最高限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出与顶部约束有关的UILabel中的autoshrink选项.

I try to figure out autoshrink option in UILabel with regarding top constraint.

我有UIView和三个标签.其中之一启用了自动收缩选项.它具有要居中的约束,并且具有尾随"和顶部"约束,在更改UIView的大小时应缩小标签.如果我使UIVIew变细,则字体大小会减小,但是如果我更改UIView字体的高度,则不会更改.

I have UIView and three labels. One of them has autoshrink option on. It has constraint to be centered, and has Trailing and Top constraint which should shrink label when changing size of UIView. If I make UIVIew thinner, font size is decreased, but if I change height of UIView font is not changed.

UILabels上的约束:

Constraints on UILabels :

  • 将Center X与Superview对齐
  • 将中心Y与Superview对齐
  • 向Superview跟踪空间> = 50
  • 要观看的顶部空间> = 40
  • 将Center X与label2对齐
  • label1的顶部空间等于:15
  • label2的底部空间等于:3

标签1约束:

  • 将Center x对齐到超级视图
  • 将空间拖到超级视图> = 10
  • 要观看的领导空间> = 10
  • 缩小标签的底部空间等于15

标签2约束:

  • 将Center X对齐以缩小标签
  • 缩小的顶部空间"标签等于3

该如何更改?

我想要的是,在最后一张图像上,标签将自动收缩.因此,如果我更改UIView标签的宽度或高度,则应该缩小.

What I want is, on last image that label will be nice autoshrink. So if I change width or height of the UIView label should shrink.

推荐答案

plz选择收缩标签集

plz select your Shrink label set

行数为0

换行符:剪辑

自动收缩:最小字体缩放0.25

这篇关于NSLabel自动收缩具有最高限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆