扫码关注官方订阅号
小伙看你根骨奇佳,潜力无限,来学PHP伐。
似乎发现了原因。translucent属性的设置与否,与self.view的Frame的位置相关。当translucent设为NO时,self.view的位置,从navbar下边界开始。反之亦然。
应该是apple自己的bug,关于navigationBar的透明度设置引起的bug有好多,目前我是选择把hidesNavigationBarDuringPresentation属性设置成NO来解决的。总比看不见的要好。
hidesNavigationBarDuringPresentation
self.extendedLayoutIncludesOpaqueBars = YES; 试试加上这句
在-(UISearchController *)searchController方法里加上 self.definesPresentationContext = YES;试试
self.definesPresentationContext = YES;
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
似乎发现了原因。translucent属性的设置与否,与self.view的Frame的位置相关。当translucent设为NO时,self.view的位置,从navbar下边界开始。反之亦然。
应该是apple自己的bug,关于navigationBar的透明度设置引起的bug有好多,目前我是选择把
hidesNavigationBarDuringPresentation属性设置成NO来解决的。总比看不见的要好。self.extendedLayoutIncludesOpaqueBars = YES; 试试加上这句
在-(UISearchController *)searchController方法里加上
self.definesPresentationContext = YES;试试