zoukankan      html  css  js  c++  java
  • iOS导航栏标题颜色

    按钮的颜色

    [self.navigationBar setTintColor:[UIColor whiteColor]];
    

    标题颜色、字体

    [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:16]}];
    

    背景颜色

    self.navigationBar.barTintColor = [UIcolor red];
    

    iOS 5 以后 UINavigationController 可以 改变UINavigationBar导航条标题颜色和字体

    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
    [UIColor colorWithRed:0 green:0.7 blue:0.8 alpha:1], UITextAttributeTextColor,
    [UIColor colorWithRed:0 green:0.7 blue:0.8 alpha:1], UITextAttributeTextShadowColor,
    [NSValue valueWithUIOffset:UIOffsetMake(0, 0)], UITextAttributeTextShadowOffset,
    [UIFont fontWithName:@"Arial-Bold" size:0.0], UITextAttributeFont,
    nil]];

    其中 UITextAttributeTextColor和UITextAttributeFont 属性是文字颜色和字体

  • 相关阅读:
    移动布局---1. 移动端布局基础
    1. CSS新特性之选择器
    1. H5新增语义化标签
    POJ 3281
    poj 1986
    POJ 3728
    poj 2763
    poj 2749
    uva 11294
    LA 3713
  • 原文地址:https://www.cnblogs.com/yate1996/p/4823688.html
Copyright © 2011-2022 走看看