Client error attempting to change layout margins of a private view
程序员文章站
2022-06-14 09:09:06
试图更改私有视图的布局边距时出现错误 解决方案: ......
试图更改私有视图的布局边距时出现错误
解决方案:
if (@available(ios 13.0, *)) { uiedgeinsets margins = view.layoutmargins; cgrect frame = view.frame; frame.origin.x = -margins.left; frame.origin.y = -margins.top; frame.size.width += (margins.left + margins.right); frame.size.height += (margins.top + margins.bottom); view.frame = frame; }