【问题标题】:What does autoresize = RM+BM mean?自动调整大小 = RM+BM 是什么意思?
【发布时间】:2014-06-08 14:16:15
【问题描述】:

我在使用 Xcode 调试控制台时得到了这个:

po [[UIWindow keyWindow] recursiveDescription]

然后我用这样的递归描述返回行

<UILabel: 0xb0b8170; frame = (138 106; 200 15); text = 'Distance'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0xb0b8220>>

“autoresize = RM+BM”是什么意思?有什么地方可以查到字母的意思吗?我还看到了类似“autoresize = LM+W+RM+TM+H+BM”的内容。

【问题讨论】:

  • 大概:左、右、上、下、边距、宽度(灵活)、高度(灵活)

标签: ios xcode debugging autolayout


【解决方案1】:

autoresize 指示在 autoresizingMask 中设置了哪些位:

RM = UIAutoresizingFlexibleRightMargin
BM = UIAutoresizingFlexibleBottomMargin

其他的遵循类似的缩写语法。

【讨论】:

    【解决方案2】:
    <SIGMAPOINT_MPAdView: 0x10db888a0; frame = (0 0; 320 50); clipsToBounds = YES; autoresize = LM+RM; layer = <CALayer: 0x282b704c0>>
    

    【讨论】:

    • 虽然这段代码可以回答这个问题,但最好在不介绍其他代码的情况下解释它是如何解决问题的,以及为什么要使用它。从长远来看,纯代码的答案没有用处。
    猜你喜欢
    • 2011-06-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-18
    • 2020-07-01
    • 2020-05-03
    相关资源
    最近更新 更多