自定义MMPopupView出现宽高为0的看过来
Opened this issue · 0 comments
iOS-Kel commented
继承MMPopupView自定义的view,在执行show或showWithBlock之后,要么使用masonry设置其宽高约束;要么能通过内容约束计算出view的大小。不能直接设置frame。举个例子:
@interface FKGenderView : MMPopupView
@EnD
@implementation FKGenderView
- (void)show {
[self showWithBlock:nil];
}
-
(void)showWithBlock:(MMPopupCompletionBlock)block {
[super showWithBlock:block];[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.equalTo(self.superview);
}];
}
@EnD
[customPopupVIew mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.equalTo(self.superview);
}];