使用DZNEmptyDataSet指定customview时报 height and vertical position are ambiguous for uiview

直接修改源码

- (void)setupConstraints
.....

if (_customView) {
        [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[customView]|" options:0 metrics:nil views:@{@"customView":_customView}]];
//        [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[customView]|" options:0 metrics:nil views:@{@"customView":_customView}]];
        CGFloat height = _customView.bounds.size.height;
        [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[customView(==height)]|" options:0 metrics:@{@"height":@(height)} views:@{@"customView":_customView}]];

    } 

customview用auto layout 布局,给customview指定bounds

你可能感兴趣的:(iOS)