Client error attempting to change layout margins of a private view

 

试图更改私有视图的布局边距时出现错误

 

解决方案:

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;
}

 

你可能感兴趣的:(Client error attempting to change layout margins of a private view)