MMPopupView icon indicating copy to clipboard operation
MMPopupView copied to clipboard

自定义MMPopupView出现宽高为0的看过来

Open iOS-Kel opened this issue 11 months ago • 0 comments

继承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); }];

iOS-Kel avatar Mar 09 '24 09:03 iOS-Kel