更改源码为下面的方法:
-
(void)didMoveToSuperview
{
CGRect frame = self.superview.bounds;
frame.origin.y = 0;
self.frame = frame;void(^fadeInBlock)(void) = ^{_contentView.alpha = 1.0;};
if (self.fadeInOnDisplay) {
[UIView animateWithDuration:0.25
animations:fadeInBlock
completion:NULL];
}
else {
fadeInBlock();
}
}
网友评论