您的位置:首页 > 其它

SDAutolayout图片大小根据数量变化

2016-09-09 21:09 239 查看
只需要在自定义的PhotoContainerView中做一下判断就可以了

if (self.photoNamesArray.count == 1) {
[self setupAutoWidthFlowItems:[temp copy] withPerRowItemsCount:1 verticalMargin:10 horizontalMargin:10 verticalEdgeInset:0 horizontalEdgeInset:0];
} else if (self.photoNamesArray.count == 2) {
[self setupAutoWidthFlowItems:[temp copy] withPerRowItemsCount:2 verticalMargin:10 horizontalMargin:10 verticalEdgeInset:0 horizontalEdgeInset:0];
} else {
[self setupAutoWidthFlowItems:[temp copy] withPerRowItemsCount:3 verticalMargin:10 horizontalMargin:10 verticalEdgeInset:0 horizontalEdgeInset:0];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: