//MARK:防止scroller被遮挡
func extendedLayout() ->Void{
self.edgesForExtendedLayout = UIRectEdge.init(rawValue: 0)
self.extendedLayoutIncludesOpaqueBars = false
self.modalPresentationCapturesStatusBarAppearance = false
}
本文介绍了一个Swift UI中防止scroller被遮挡的方法。通过调整UI控制器的extendedLayout属性,包括edgesForExtendedLayout、extendedLayoutIncludesOpaqueBars及modalPresentationCapturesStatusBarAppearance等,实现scroller在不同状态下的正常显示。
//MARK:防止scroller被遮挡
func extendedLayout() ->Void{
self.edgesForExtendedLayout = UIRectEdge.init(rawValue: 0)
self.extendedLayoutIncludesOpaqueBars = false
self.modalPresentationCapturesStatusBarAppearance = false
}
1614
1030
3066
7132

被折叠的 条评论
为什么被折叠?