IOS Development – Setting the Color and Font Properties of Navigation Bar

Time:2019-8-13

The code is as follows:

#define kColorBarTint   [UIColor colorWithRed:56/255.0 green:170/255.0 blue:27/255.0 alpha:1.0]


#import "SSMyViewController.h"

@interface SSMyViewController ()

@end

@implementation SSMyViewController

-(void)viewDidLoad {
    [super viewDidLoad];
    // Set Navigation Bar Background Color & Title Color
    [self.navigationController.navigationBar setBarTintColor:kColorBarTint];
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:22],NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
}

-(void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}



@end

Recommended Today

Implementation of PHP Facades

Example <?php class RealRoute{ public function get(){ Echo’Get me’; } } class Facade{ public static $resolvedInstance; public static $app; public static function __callStatic($method,$args){ $instance = static::getFacadeRoot(); if(!$instance){ throw new RuntimeException(‘A facade root has not been set.’); } return $instance->$method(…$args); } // Get the Facade root object public static function getFacadeRoot() { return static::resolveFacadeInstance(static::getFacadeAccessor()); } protected […]