• 关于iOS7.0以后修改navigationBar的返回按钮的文本、颜色、自定义按钮等等


    1、返回按钮的颜色

    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

    2、设置返回按钮的内容

    A -> B

    在push的时候,在A中添加代码:

    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
    backItem.title = @"你的文字";
    self.navigationItem.backBarButtonItem = backItem;

    3、自定义navigationBar按钮

    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"全部已读" style:UIBarButtonItemStylePlain target:self action:@selector(allReadedTapped)];

     self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"backIcon"] style:UIBarButtonItemStyleBordered target:self action:@selector(backButtonTouched:)];

    4、自定义navigationBar的title内容和字体大小、颜色

    self.title = @"登 录";

    self.navigationController.navigationBar.titleTextAttributes = @{

                                                                        NSFontAttributeName:[UIFont systemFontOfSize:17],

                                                                        NSForegroundColorAttributeName:[UIColor whiteColor]

                                                                        };

    5、设置navigationBar的背景颜色

    self.navigationController.navigationBar.barTintColor = [UIColor colorFromHexRGB:@"3bad6f" alpha:1.0f];

    6、取消系统中navigationBar的自带的半透效果

    self.navigationController.navigationBar.translucent = NO;

     
  • 相关阅读:
    oracle归档日志增长过快处理方法
    Oracle“死锁”模拟
    Oracle 手工清除回滚段的几种方法
    Oracle 一次 锁表 处理小记
    Oracle中如何判断一个字符串是否含有汉字
    机房收费系统验收总结
    hdu 4747 Mex (线段树)
    Java 5 的新标准语法和用法详解集锦
    java类加载器行为[笔记]
    poj1330Nearest Common Ancestors(LCA小结)
  • 原文地址:https://www.cnblogs.com/ChouDanDan/p/5379390.html
Copyright © 2020-2023  润新知