UIView.SizeToFit Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
[Foundation.Export("sizeToFit")]
public virtual void SizeToFit ();
abstract member SizeToFit : unit -> unit
override this.SizeToFit : unit -> unit
- Attributes
Remarks
Calling this method resizes the UIView so that it just encloses its subviews. Some UIView that do not have their Superview property set resize themselves to the screen bounds, so application developers should generally make sure that they have assembled an appropriate view hierarchy before calling SizeToFit().
Application developers should not override this method. Instead, application developers should override SizeThatFits(CGSize), which this method will call.
Applies to
See also
- <xref:UIKit.UIView.SizeThatFits>