UINavigationController上的自定义titleView动画设置不正确

dea*_*_au 8 animation cocoa-touch uinavigationcontroller titleview

我可能在这里做错了,因为这看起来有点愚蠢.
我在我的UINavigationController上设置了一个自定义titleView(以UILabel的形式),在每个页面上都是相同的.为了实现这一点,我在我的app delegate中创建了一个函数来正确显示标签.然后我将其推送到导航堆栈后,在任何子视图上调用此函数.
这是代码(可能比我的解释更有意义):

//In MyAppDelegate.m:
- (void)showTitleForNavigationController:(UINavigationController*) navController {
    UILabel *label = [[UILabel alloc] init];
    // set up label attributes
    // ...
    [label sizeToFit]; //without this line my label won't show at all
    [navController.navigationBar.topItem setTitleView:label];
    [label release];
}

// In SomeViewController.m, when pushing another controller onto the stack:
    UIViewController *otherViewController = //initialize other view controller;
    [self.navigationController pushViewController:otherViewController animated:YES];
    [(MyAppDelegate*)[[UIApplication sharedApplication] delegate] showTitleForNavigationController:otherViewController.navigationController];
Run Code Online (Sandbox Code Playgroud)

我的问题是,当我将下一个视图控制器推入堆栈,并且新控制器平滑地滑动时,在动画的整个持续时间内,标签粘贴在左上方,然后在动画结束后最终捕捉到位.它看起来很奇怪和丑陋.如何正确设置标签,使其从下一个视图平滑滑动?当然,这很简单,我很想念......

dea*_*_au 0

我最终做的是使用包含文本的图像作为标题的背景,因此它根本没有动画,而不是像我最初想要的那样平滑地动画。
考虑到到处都是相同的标题,这没什么大不了的。