我尝试维护现有代码并向UITextView
添加了新的View Controller
。所有视图都从左侧滑入,进入屏幕。我新添加的视图也从左侧和其他视图一起滑入(没有我做任何事情,因为动画是在他们的容器上设置的)。问题是我的视图在动画开始之前也会出现一秒左右。我怎样才能防止这种情况发生?
以下是容器上动画的代码
- (void) showAndAnimateContainerView{
[self.containerView setHidden:NO];
[self hideContainerView:self.containerView];
self.marginLeft.constant = 0;
[UIView animateWithDuration:STD_ANIMATION_TIME delay:ZERO_ANIMATION_TIME options:UIViewAnimationOptionCurveLinear animations:^{
[self.containerView layoutIfNeeded];
} completion:^(BOOL finished) {
}];
}
- (void) hideContainerView:(UIView *) view{
self.widthView.constant = WIDTH_SCREEN;
self.marginLeft.constant = -WIDTH_SCREEN;
[view layoutIfNeeded];
}
不知道我还能在问题中添加什么来使其更清晰。