Safe area layout guides can be disabled in Interface Builder by unchecking the Use Safe Area Layout Guides
. How can this be done in code?
I didn't notice an iOS11-available boolean that directly corresponds with the checkbox.
Safe area layout guides can be disabled in Interface Builder by unchecking the Use Safe Area Layout Guides
. How can this be done in code?
I didn't notice an iOS11-available boolean that directly corresponds with the checkbox.
I think the only way to accomplish this programmatically is to override the safeAreaLayoutGuide property.
override var safeAreaLayoutGuide: UILayoutGuide {
return UILayoutGuide()
}
When you disable it through IB it still returns a UILayoutGuide but with zero layoutFrame, by returning an instance of UILayoutGuide, you are basically doing the same.
© 2022 - 2024 — McMap. All rights reserved.
UIView
’ssafeAreaInsets
are not zero and rendering on screen wheninsetsLayoutMarginsFromSafeArea
isfalse
. – ElburtsafeAreaLayoutGuide
is a readonly property onUIView
, so this isn't just some that applies to xibs and storyboards in Interface Builder. I just don't know how to disable it. – Elburt