Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

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

Open
iOS-Kel opened this issue Mar 9, 2024 · 0 comments
Open

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

iOS-Kel opened this issue Mar 9, 2024 · 0 comments

Comments

@iOS-Kel
Copy link

iOS-Kel commented Mar 9, 2024

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant