MFMailComposeViewController bar background color not changing in iOS7

前端 未结 9 1444
情歌与酒
情歌与酒 2020-12-31 00:32

I\'m trying to change the background color of the MFMailComposeViewController in iOS7 but I cannot make it work.

I\'m

相关标签:
9条回答
  • 2020-12-31 01:11

    First present the MFMailComposeViewController then change its tintColor

    [self presentViewController:emailDialog animated:TRUE completion:nil];
    
    [[UINavigationBar appearance] setBackgroundImage:nil 
                                      forBarPosition:UIBarPositionTopAttached 
                                          barMetrics:UIBarMetricsDefault];
    
    0 讨论(0)
  • 2020-12-31 01:12

    Swift 3 solution:

    extension MFMailComposeViewController {
        override open func viewDidAppear(_ animated: Bool) {
            super.viewDidAppear(animated)
            UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent
        }
    
        open override func viewDidLoad() {
            super.viewDidLoad()
            navigationBar.isTranslucent = false
            navigationBar.isOpaque = false
            navigationBar.barTintColor = UIColor.white
            navigationBar.tintColor = UIColor.white
        }
    }
    
    0 讨论(0)
  • 2020-12-31 01:12

    try this but one thing BarTintColor available only iOS7

    [[UINavigationBar appearance] setBarTintColor:[UIColor redColor]];
    

    This color is made translucent by default unless you set the translucent property to NO.

    or try this link it will more helpful you

    Changing MFMailComposeViewController's toolbar color

    0 讨论(0)
提交回复
热议问题