标签:hub alpha ntc 其他 ges round sha test hang
有很多属性可以决定导航栏的视觉效果,下面做一下总结
barStyle 属性defaultblackblackOpaque 和 blackTranslucent 已被 Deprecated。
这个属性的优先级是最低的,其他的任何属性会覆盖这个属性的效果。
Any changes you make to other navigation bar appearance properties override those inferred from the bar style.
isTranslucent是否是半透明的
barTintColor 和 tintColorbarTintColor 决定导航栏的背景色
tintColor 决定导航栏中文字的颜色
优先级最高。
分别是 setBackgroundImage(_:for:barMetrics:) 方法和 shadowImage 属性
To use the custom shadow image, you need to have specified a custom background image
查看一个导航栏的外观,流程应该是这样子的
isTranslucent 属性来走isTranslucent 为false,那么系统为背景图提供一个不透明的背景。背景颜色由 barStyle 和 barTintColor 决定isTranslucent 为 true,那么背景图的 alpha 值变为小于 1 的系统值。标签:hub alpha ntc 其他 ges round sha test hang
原文地址:https://www.cnblogs.com/huahuahu/p/UINavigationBar-de-shi-jue-xiao-guo.html