UINavigationBar属性设置

来源:互联网 发布:淘宝店最高收入多少 编辑:程序博客网 时间:2024/05/21 11:11
    UINavigationBar *bar = [UINavigationBar appearance];        //导航栏颜色    bar.barTintColor = [UIColor colorWithRed:147/255.0f green:194/255.0f blue:220/255.0f alpha:1.0f];    //设置导航栏不透明    bar.translucent = NO;    //设置导航栏左右按钮的颜色    bar.tintColor = [UIColor whiteColor];    //设置导航栏中间文字主题    [bar setTitleTextAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:17],NSForegroundColorAttributeName : [UIColor whiteColor]}];    //设置当行兰背景图片    [bar setBackgroundImage:[UIImage imageNamed:(nonnull NSString *)] forBarMetrics:UIBarMetricsDefault];
1 0
原创粉丝点击