We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 iOS13 上,适配红点功能:避免红点颜色受 iOS13 TabBarItem 内引入的毛玻璃效果影响。
在iOS13上,如果TabBar或者TabBarItem未设置如下几个相关方法:
barTintColor
setUnselectedItemTintColor
setBackgroundImage
setBackgroundColor
是否设置过,结构对比图如下:
从图上可以看出:未设置时,系统会给处于未选中(unselected)状态的 TabBarItem 加一个毛玻璃效果,为灰色,以此来充当UnselectedItemTintColor 保证在 Dark Mode 中显得正常。
UnselectedItemTintColor
这个改动会导致:
解决办法:
CYLTabBarController自动移除的逻辑如下:
当 CYLTabBarController 发现有毛玻璃效果,就内部默认设置 setUnselectedItemTintColor ,颜色为未选中 Item 的 Label 颜色,无 label 时取默认值 systemGrayColor。
systemGrayColor
隐藏TabBar顶部分割线的实现,就是在原有基础上把修改ShadowImageView的透明度,改为修改hidden属性。
The text was updated successfully, but these errors were encountered:
//去除 TabBar 自带的顶部阴影 需要使用 -[CYLTabBarController hideTabBarShadowImageView]
见README
Sorry, something went wrong.
No branches or pull requests
CYLTabBarController 【iOS13 Dark Mode版本】v1.27.0 已经发布,更新日志
效果图
原理解析
在iOS13上,如果TabBar或者TabBarItem未设置如下几个相关方法:
barTintColor
setUnselectedItemTintColor
setBackgroundImage
setBackgroundColor
是否设置过,结构对比图如下:
从图上可以看出:未设置时,系统会给处于未选中(unselected)状态的 TabBarItem 加一个毛玻璃效果,为灰色,以此来充当
UnselectedItemTintColor
保证在 Dark Mode 中显得正常。这个改动会导致:
解决办法:
CYLTabBarController自动移除的逻辑如下:
当 CYLTabBarController 发现有毛玻璃效果,就内部默认设置
setUnselectedItemTintColor
,颜色为未选中 Item 的 Label 颜色,无 label 时取默认值systemGrayColor
。隐藏TabBar顶部分割线的实现,就是在原有基础上把修改ShadowImageView的透明度,改为修改hidden属性。
The text was updated successfully, but these errors were encountered: