所以我有一个导航栏,它有一条水平线,我想删除.
我从屏幕截图中删除了导航栏颜色,使线条更加明显.
我已经尝试将导航栏的阴影图像属性设置为空白png(1x1像素pngs为1x,2x和3x),但没有效果.
小智 71
这两行代码总是对我有用:
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
navigationController?.navigationBar.shadowImage = UIImage()
Run Code Online (Sandbox Code Playgroud)
Kub*_*bba 22
如果你想在全球范围内做,你可以这样做:
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28171 次 |
| 最近记录: |