UIView. Rect For Frame(CGRect) Alignment
Rect For Frame(CGRect)
Returns a customized alignment rectangle for Auto Layout.
[Foundation.Export("alignmentRectForFrame:")] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)] public virtual CoreGraphics.CGRect AlignmentRectForFrame (CoreGraphics.CGRect frame);
abstract member AlignmentRectForFrame : CoreGraphics.CGRect -> CoreGraphics.CGRect override this.AlignmentRectForFrame : CoreGraphics.CGRect -> CoreGraphics.CGRect
By overriding this method, application developers can fully customize the alignment rectangle of the UIView.Application developers who override this method must also override the complementary method FrameForAlignmentRect(CGRect). The two methods must provide complementary values.
Auto Layout uses "alignment rectangles" to layout subviews rather than the subviews' Frame. The Frame of a UIView may include visual elements, such as drop-shadows, that are not symmetrical around the UIView's logical center. The "alignment rectangle" for a UIView should be related to its logical content.
By default, the "alignment rectangle" of a UIView is the Frame plus the AlignmentRectInsets. The AlignmentRectForFrame(CGRect) and FrameForAlignmentRect(CGRect) methods can be used to fully customize the alignment rectangle.
Send feedback about: