【问题标题】:How to get the current constant value from different constants value?如何从不同的常量值中获取当前的常量值?
【发布时间】:2016-03-04 10:19:50
【问题描述】:

我为两个不同的类设置了约束常量,当我尝试在 wRhR(ipads) 上打印常量时,第一个常量值即将到来。

我总是得到 ​​p>

  NSLog(@"this is constant %f",_txtbottomconstraints.constant);

输出:

 this is constant 240.000000  //this output is am getting in ipad.

帮我获取当前的常量值谢谢:)

【问题讨论】:

  • 您在为 iPad 打印吗?
  • @techlorr 是的兄弟 :(
  • @Hima 但 ipad 要返回 240 吗?做什么
  • @Hima 你写了反向声明
  • 投反对票的原因?

标签: ios objective-c constraints nslayoutconstraint


【解决方案1】:

在 viewDidAppear 中打印

override func viewDidAppear(animated: Bool) {
        print("constraint  : \(_txtbottomconstraints.constant)");
    }

【讨论】:

  • 我已经把这个给版主了,为什么要无缘无故地投反对票?
  • 他们会调查这个
  • 是的,它已经用完了,如果可能的话,你能简要说明一下视图会出现吗?
猜你喜欢
  • 2014-12-20
  • 2016-02-14
  • 2021-05-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-19
相关资源
最近更新 更多