我正在显示一个图片导航栏,但标题已经消失了,为什么?
怎么修呢?
@"navbar.png"; * UIImage = UIImage imageNamed:
UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
self.navigationItem.titleView=imageView;
[imageView release];
// self.title = @"Bio";
self.navigationItem.title = @"Bio";
}
非常感谢!
发布于 2011-09-14 06:14:57
您已经用图像视图替换了标题视图,因此导航栏不能再显示标题。
如果您想要文本和图像,则需要添加一个具有UILabel
子视图作为titleView的图像视图,并设置UILabel
的文本。
https://stackoverflow.com/questions/7417623
复制