我想将视图放入 UIScrollView。
Price* p = _entity.prices[0];
ItemPriceCell *cell = [[ItemPriceCell alloc] initWithFrame:CGRectZero];
cell.priceLabel.attributedText = [Helper stylePriceLabel:p.priceString withFont:[UIFont fontWithName:@"OpenSans-Semibold" size:34]];
cell.priceLabel.textColor = [Helper color:self.shop.currentTheme.options.itemPriceTextColor];
cell.priceNameLabel.text = [NSString stringWithFormat:@"%@",[p definition]];
cell.priceNameLabel.textColor = [Helper color:self.shop.currentTheme.options.itemDetailTextColor];
[self.horizontalScrollView addSubview:cell];
现在可以看到价格单元格。但是,如果我添加此代码:
[cell mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.equalTo(@200);
make.height.equalTo(@50);
make.top.equalTo(@0);
make.left.equalTo(@0);
make.right.equalTo(@0);
make.bottom.equalTo(@0);
}];
价格视图被隐藏。我哪里错了?