Share via


UIView.TranslatesAutoresizingMaskIntoConstraints 属性

定义

指定是否应将自动调整大小掩码转换为自动布局的约束。

[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual bool TranslatesAutoresizingMaskIntoConstraints { [Foundation.Export("translatesAutoresizingMaskIntoConstraints")] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)] get; [Foundation.Export("setTranslatesAutoresizingMaskIntoConstraints:")] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)] set; }
member this.TranslatesAutoresizingMaskIntoConstraints : bool with get, set

属性值

默认值为 true

属性

注解

如果此属性为 true,则此 UIViewSuperview 会将此 UIViewAutoresizingMask 转换为 NSLayoutConstraint,并将其包含在 Superview的 中Constraints。 这将完全约束此 , UIView 并且自动布局将无法调整大小或重新定位此 UIView

如果应用程序开发人员正在使用自动布局,请将此属性设置为 false 允许自动布局更改此 UIView的布局。

在过度约束的自动布局中,自动布局调试信息中 的外观 NSAutoresizingMaskLayoutConstraint 通常表明应用程序开发人员已将此属性不当保留为 true 某个位置。

适用于