MTA*_*MTA 0 objective-c uiview ios
我使用此代码在2之间进行更改UIView
:
UIViewAnimationOptions animationType = UIViewAnimationOptionTransitionFlipFromLeft;
[UIView transitionFromView:self.playlistTableView toView:self.playerView duration:0.5 options:animationType completion:^(BOOL finished){
[self.containerView sendSubviewToBack:self.upperView];
[self.containerView sendSubviewToBack:self.playerView];
self.isPlaylistVisible = !self.isPlaylistVisible;
isControlsHidden = NO;
}];
Run Code Online (Sandbox Code Playgroud)
而且我注意到一种奇怪的行为,当我将翻转的高度调整为self.playerView
20px并且在一秒之后,它会增加回到正常的帧大小.
我尝试更改animationType
为UIViewAnimationOptionLayoutSubviews
,现在当我在视图之间切换时,不会发生此行为.知道可能是什么问题吗?
请试试这段代码.
[self.upperView setHidden:YES];
[self.playerView setHidden:NO];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:containerView cache:YES];
[UIView setAnimationDuration:1.0];
[UIView commitAnimations];
[containerView addSubview:self.playerView];
Run Code Online (Sandbox Code Playgroud)
获得反向案件
[self.upperView setHidden:NO];
[self.playerView setHidden:YES];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:containerView cache:YES];
[UIView setAnimationDuration:1.0];
[UIView commitAnimations];
[containerView addSubview:self.upperView];
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
276 次 |
最近记录: |