IOS 自定义标题文字

来源:互联网 发布:网络强国的建设体现为 编辑:程序博客网 时间:2024/05/15 02:48

    self.navigationItem.leftBarButtonItem=[[[UIBarButtonItemalloc] initWithTitle:@"返回"style:UIBarButtonItemStylePlaintarget:selfaction:@selector(pushAction)]autorelease];

   UILabel *customLab = [[UILabelalloc] initWithFrame:CGRectMake(0,0, self.view.frame.origin.x/2,30)];

    [customLab setTextColor:[UIColorwhiteColor]];

    [customLabsetText:@"标题"];

    customLab.font = [UIFontboldSystemFontOfSize:30];

    self.navigationItem.titleView = customLab;


0 0