I need to increase the height of the navigation bar. For this, I have added a view (of desired height) under the navigation bar. The navigation bar is set to be translucent. So the nav bar color is rendered slightly different than the actual hex value. Now I need to match the navigation bar's color to the view below. Following is the code that I am using.
func setupNavigationBar() {
title = "Profile"
self.navigationController?.navigationBar.setBackgroundImage(UIImage(named: ""), for: .default)
self.navigationController?.navigationBar.shadowImage = UIImage(named: "")
headerView.backgroundColor = navigationController?.navigationBar.barTintColor
headerView.isOpaque = false
}
I am getting different shades as below.
How can i make the view's color to be the same as navigation bar's color? I can get near to the desired color by reducing the view's alpha but I am doubtful about that approach since there is no standard defined regarding it.
P.S. The navigation bar has to stay translucent.