Skip to content

Conversation

@liLeiBest
Copy link

UIImage *img = [UIImage imageNamed:@"hub_warning_icon"];
UIImageView *customView = [[UIImageView alloc] initWithImage:img];
for (NSUInteger i = 0; i < 2; i++) {
    
    MBProgressHUD *hud = [self toastToView:self.view];
    hud.mode = MBProgressHUDModeCustomView;
    [hud setCustomView:customView];
    hud.label.text = @"Title";
    hud.detailsLabel.text = @"Content";
    [hud hideAnimated:YES afterDelay:2];
}

The above code will crash, and the log is as follows:

Thread 1: "Unable to install constraint on view. Does the constraint reference something from outside the subtree of the view? That's illegal. constraint:<NSLayoutConstraint:0x600003178870 UIImageView:0x151007950.centerX == MBBackgroundView:0x14fe48390.centerX (active)> view:<MBBackgroundView: 0x14fe48390; frame = (0 0; 0 0); clipsToBounds = YES; animations = { opacity=<CASpringAnimation: 0x600001258160>; }; layer = <CALayer: 0x600001260c60>>"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant