美文网首页
导航条设置

导航条设置

作者: Mrxiaowang | 来源:发表于2017-12-26 14:16 被阅读4次

    //导航条统一设置

        UIFont *font = [UIFont fontWithName:@"Helvetica" size:18.0];//标题字体大小

        NSDictionary *textAttributes = @{NSFontAttributeName : font,NSForegroundColorAttributeName:[UIColor whiteColor],};

        [[UINavigationBar appearance] setTitleTextAttributes:textAttributes];

    //导航条颜色

        [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

        [[UINavigationBar appearance] setTranslucent:NO];

        [[UINavigationBar appearance] setBarTintColor:navigationColor];

    //导航条按钮设置

        [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:14], NSForegroundColorAttributeName: [UIColor whiteColor]} forState:UIControlStateNormal];

    相关文章

      网友评论

          本文标题:导航条设置

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