先前给UINavigation添加图片成功,后来添加标题:
self.title=@"Activity";
没显示任何内容。
我用另一种方法添加标题标签,在第一个视图控制器运行成功,但是在第二个视图控制器修改标题后还是显示先前的标题。
代码:
UIImage *image = [UIImage imageNamed:@"Nav.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[self.navigationController.navigationBar addSubview:imageView];
titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(50,2,250,36)];
titleLabel.text=@"Activity";
titleLabel.textColor=[UIColor whiteColor];
titleLabel.backgroundColor=[UIColor clearColor];
titleLabel.font=[UIFont fontWithName:@"Helvetica-Bold" size :18];
//titleLabel boldSystemFontOfSize:14.0;
[self.navigationController.navigationBar addSubview:titleLabel];