我正在尝试为 Iphone 应用程序 iOS 5.0+ 自定义 titleView 。所以我放了一个这样的图形:
UIView *customTitleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 104, 72)];
UIImageView *customTitleGraphics = [[UIImageView alloc] initWithImage:image];
[customTitleGraphics setTag:kNavigationImageView];
CGRect myFrame = customTitleGraphics.frame;
myFrame.origin.y = 15.0;
myFrame.origin.x = -3.0;
customTitleGraphics.frame = myFrame;
[customTitleView addSubview:customTitleGraphics];
navigationItem.titleView = customTitleView;
它到目前为止有效。我遇到的问题是当我尝试推送另一个 viewController 时:看起来 titleView 在动画开始时突然被切断了。
https://www.dropbox.com/s/0ysiroxayfld1l3/titleview.mov?v=1mci
你知道我哪里错了吗?