English 中文(简体)
为何在自定义比例尺和翻动画之后在任务栏下绘制视图?
原标题:Why does view draw under the task bar after a custom scale and flip animation?

“https://stackoverflow.com/q/10468333/79202”>前一个问题 相同的代码,但有一个不同的问题。

我创建了一个自定义动画, 以添加一个查看控制器到 UINAVIGATION 控制器。 此代码将视图缩放为原始大小的 80%, 然后翻转它, 然后将它缩放到原来的大小 :

[UIView animateWithDuration:scaleDuration delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
    // Scale the controllers  views down.
    self.view.transform = CGAffineTransformScale(self.view.transform, 0.8, 0.8);
} completion:^(BOOL finished) {
    // Transition to the new view and push on the new view controller.
    [UIView transitionWithView:self.view duration:1 options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionTransitionFlipFromLeft animations:^{
        [self pushViewController:viewController animated:NO];
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:scaleDuration delay:0 options:UIViewAnimationOptionCurveLinear animations:
^{
            // Scale back to the original size.
            self.view.transform = CGAffineTransformScale(self.view.transform, 1.25, 1.25);
        } completion:nil];
    }];
}];

问题是, 当动画完成时, 新的视图会显示得非常漂亮, 只是在任务栏下绘制。 也就是说, 它会从屏幕源 0, 0, 而不是 0, 20。 “ 状态栏” 选项设置在 IB 中( 设置为“ 黑色 ” ), 当然, 如果我使用标准的 UINAvigation Condenter 驱动动画, 只有我定制的动画, 这不会发生 。 如果我在动画后旋转设备, 旋转时的重划将它移动到合适的位置 。 但是, 我如何首先做到这一点?

作为添加的皱纹, 如果我移动 < code> pushViewCovernor: animerated: 调出一条线到 < code> 补全块 : 块, 它不会在任务栏下提取( 不过, 这样一来, 视图会自动翻转, 然后突然显示新视图, 当然 ) 。

最佳回答

我发现目前为止唯一的工作就是 隐藏导航栏 然后展示给大家看

在您设置变换后,添加以下两行:

[self setNavigationBarHidden:YES];
[self setNavigationBarHidden:NO];

虽然丑陋,但有效,我也在寻找更好的解决办法。

注意: 版面视图, 设置 NeedsLayount 将无法工作 。

问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签