美文网首页
设置导航栏

设置导航栏

作者: 骑着蜗牛做开发 | 来源:发表于2017-05-04 11:42 被阅读0次

1.标题设置 (更改标题 颜色以及字体大小)

self.title = @"推荐礼品";

[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:19],NSForegroundColorAttributeName:[UIColor redColor]}];


2.  < Back  变成   <       ( 在上一个控制其里边push的时候 )

UIBarButtonItem *backBtn = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:nil];

//把backBtn作为下一个界面的返回按钮;

self.navigationItem.backBarButtonItem = backBtn;


或者在当前控制器 

[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)

forBarMetrics:UIBarMetricsDefault];

相关文章

网友评论

      本文标题:设置导航栏

      本文链接:https://www.haomeiwen.com/subject/cfxiuttx.html