在这个例子中.
当我为tabBarController设置动画(用于全屏效果)时,我正在为PhotoViewerViewController的框架设置动画.PhotoViewer使用uiscrollview生成Apple的照片应用程序所具有的相同效果.无论出于何种原因,它有时会与我的PhotoViewer框架一起动画,有时则不会.
您可以在第一个示例中看到它在增加帧大小时跳转,但在减小帧大小(并恢复标签栏)时可以很好地动画.
然而,在这个例子中,当照片是垂直的时,它会向两个方向跳跃.
在这两种情况下,如果我使用滚动视图完全放大照片,它会在两个方向上正确动画.
我知道有证据,但我无法理解这里发生的事情.
这是我的动画块:
void (^updateProperties) (void) = ^ {
self.navigationController.navigationBar.alpha = hidden ? 0.0f : 1.0f;
self.navigationController.toolbar.alpha = hidden ? 0.0f : 1.0f;
if (self.tabBarController) {
int height = self.tabBarController.tabBar.bounds.size.height;
for(UIView *view in self.tabBarController.view.subviews)
{
int newHeight;
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (UIInterfaceOrientationIsPortrait(orientation)) {
newHeight = hidden ? [[UIScreen mainScreen] bounds].size.height : [[UIScreen mainScreen] bounds].size.height - height;
} else {
newHeight = hidden ? [[UIScreen mainScreen] bounds].size.width : [[UIScreen mainScreen] …Run Code Online (Sandbox Code Playgroud)