【发布时间】:2015-06-04 03:55:54
【问题描述】:
我使用自适应布局功能来设计应用。我采用“Aspect Ratio”约束的IBOutlet。我想将此纵横比值的值更改为当前值的两倍。问题是“constraint”属性可以从代码中轻松设置,但“multiplier”属性是只读属性。对于纵横比更改,“乘数”值更改是必要的。我该怎么做?
@property (retain, nonatomic) IBOutlet NSLayoutConstraint *leftImageWidthAspectRatio;
在代码中
NSLog(@"cell.leftImageWidthAspectRatio:%@ : %lf %lf",cell.leftImageWidthAspectRatio, cell.leftImageWidthAspectRatio.constant,cell.leftImageWidthAspectRatio.multiplier);
结果
cell.leftImageWidthAspectRatio:<NSLayoutConstraint:0x7c9f2ed0 UIView:0x7c9f2030.width == 2*RIFeedThumbImageView:0x7c9f2c90.width> : 0.000000 2.000000
【问题讨论】:
标签: ios iphone adaptive-ui adaptive-layout