`
lizhuang
  • 浏览: 887876 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

autolayout content hug

 
阅读更多
Say you've got button like this:

[       Click Me      ]
and you've pinned the edges to a larger superview with priority 500.

Then, if Hugging priority > 500 it'll look like this:

[Click Me]
If Hugging priority < 500 it'll look like this:

[       Click Me      ]
If superview now shrinks then, if the Compression Resistance priority > 500, it'll look like this

[Click Me]
Else if Compression Resistance priority < 500, it could look like this:

[Cli..]
If it doesn't work like this then you've probably got some other constraints going on that are messing up your good work!

E.g. you could have it pinned to the superview with priority 1000. Or you could have a width priority. If so, this can be helpful.

Editor > Size to Fit Content
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics