How can I get the color and translucency of the iOS 10 watch Navigation Bar?

前端 未结 2 1106
刺人心
刺人心 2020-12-22 05:27

I am looking to get the translucency and color of the iOS 10 watch navigation bar. I managed the color by color picking the RGB but I cannot figure out the translucency. I a

相关标签:
2条回答
  • 2020-12-22 06:16

    If you mean you want to get rid of translucent effect, just

    Programatically:

    navigationController?.navigationBar.isTranslucent = false
    

    In Storyboard:

    Just click on the navigation bar, and in attribute inspector, you'll find it.

    0 讨论(0)
  • 2020-12-22 06:20

    Use below method to achieve navigationBar translucent effect. When UIContentView scrolls as the picture you posted.

    In viewDidLoad:

      view.backgroundColor = UIColor.black
      navigationController?.navigationBar.barStyle = UIBarStyle.blackTranslucent
      navigationController?.navigationBar.tintColor = UIColor.white
    

    Updated

    Output:

    Note:

    • Screen recording is not showing the real result.I recommend you to test the code in a real device.

    • You can use the same method. If you developing tabBar based project.

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