ios6 - iOS 6 auto layout 下VisualFormat 如何表达两个控件的距离上边距的距离相等?
巴扎黑
巴扎黑 2017-04-17 11:35:43
0
1
549
[contentView addConstraints:
         [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-65-[userNameLabel]-5-[hotLabel]-(-17)-[hotImgView]"
                                                 options:0
                                                 metrics:nil
                                                   views:NSDictionaryOfVariableBindings(userNameLabel,hotLabel,hotImgView)]];

其中hotLabl 与 hotImgView 的距离上边的高度相等,我这种写法感觉还麻烦,不知道有什么方法能表示距离上边距相等和距离左边距相等的VLF 表示方法

巴扎黑
巴扎黑

reply all(1)
大家讲道理

This one is really unfamiliar. . But as for how to simplify an expression that is too cumbersome:

  1. Use extension: extend UIView and add a method to return these data
  2. Tool method: Make a tool class, static method, pass the view object into it, and then return the data you need
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template