美文网首页
设置导航栏背景色

设置导航栏背景色

作者: 然亦伞 | 来源:发表于2016-01-26 14:41 被阅读64次

    - (void)viewWillAppear:(BOOL)animated{

    [super viewWillAppear:animated];

    [self.navigationController.navigationBar setBackgroundImage:[self userRGBColorCreatImage:UIColorFromRGBA(238, 11, 59, 1)]

    forBarPosition:UIBarPositionAny

    barMetrics:UIBarMetricsDefault];

    [self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];

    }

    - (void)viewWillDisappear:(BOOL)animated{

    [super viewWillDisappear:animated];

    [self.navigationController.navigationBar setBackgroundImage:[self userRGBColorCreatImage:kMainColorOfApp]

    forBarPosition:UIBarPositionAny

    barMetrics:UIBarMetricsDefault];

    [self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init] ];

    }

    相关文章

      网友评论

          本文标题:设置导航栏背景色

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