Class NSView
- Namespace
- CarinaStudio.MacOS.AppKit
- Assembly
- CarinaStudio.AppBase.MacOS.dll
NSView.
public class NSView : NSResponder, IDisposable, IEquatable<NSObject>
- Inheritance
-
NSView
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
NSView(NSRect)
Initialize new NSView instance.
public NSView(NSRect frame)
Parameters
frameNSRectFrame.
NSView(Class, IntPtr, bool)
Initialize new NSView instance.
protected NSView(Class cls, IntPtr handle, bool ownsInstance)
Parameters
clsClassClass of instance.
handlenintHandle of instance.
ownsInstanceboolTrue to own the instance.
NSView(IntPtr, NSRect)
Initialize new NSView instance.
protected NSView(IntPtr handle, NSRect frame)
Parameters
NSView(IntPtr, bool, bool)
Initialize new NSView instance.
protected NSView(IntPtr handle, bool verifyClass, bool ownsInstance)
Parameters
handlenintHandle of instance.
verifyClassboolTrue to verify whether instance is NSView or not.
ownsInstanceboolTrue to own the instance.
Properties
Appearance
Get or set appearance of view.
public NSAppearance? Appearance { get; set; }
Property Value
BottomAnchor
Get layout anchor representing the bottom edge of the view’s frame.
public NSLayoutYAxisAnchor BottomAnchor { get; }
Property Value
Bounds
Get or set bounds rectangle of view.
public NSRect Bounds { get; set; }
Property Value
BoundsRotation
Get or set rotation of bounds in degrees.
public double BoundsRotation { get; set; }
Property Value
CenterXAnchor
Get layout anchor representing the horizontal center of the view’s frame.
public NSLayoutXAxisAnchor CenterXAnchor { get; }
Property Value
CenterYAnchor
Get layout anchor representing the vertical center of the view’s frame.
public NSLayoutYAxisAnchor CenterYAnchor { get; }
Property Value
Constraints
Get constraints held by the view.
public NSArray<NSLayoutConstraint> Constraints { get; }
Property Value
FirstBaselineAnchor
Get layout anchor representing the baseline for the topmost line of text in the view.
public NSLayoutYAxisAnchor FirstBaselineAnchor { get; }
Property Value
FittingSize
Get the minimum size of the view that satisfies the constraints it holds.
public NSSize FittingSize { get; }
Property Value
Frame
Get or set frame of view in its superview’s coordinate system.
public NSRect Frame { get; set; }
Property Value
FrameRotation
Get or set rotation of frame in degrees.
public double FrameRotation { get; set; }
Property Value
HeightAnchor
Get layout anchor representing the height of the view’s frame.
public NSLayoutDimension HeightAnchor { get; }
Property Value
IntrinsicContentSize
Get natural size of view.
public NSSize IntrinsicContentSize { get; }
Property Value
IsFlipped
Check whether the view uses a flipped coordinate system.
public bool IsFlipped { get; }
Property Value
IsHidden
Get or set whether view is hidden or not.
public bool IsHidden { get; set; }
Property Value
IsHiddenOrHasHiddenAncestor
Check whether view or its ancestor is hidden or not.
public bool IsHiddenOrHasHiddenAncestor { get; }
Property Value
LastBaselineAnchor
Get layout anchor representing the baseline for the bottommost line of text in the view.
public NSLayoutYAxisAnchor LastBaselineAnchor { get; }
Property Value
LeadingAnchor
Get layout anchor representing the leading edge of the view’s frame.
public NSLayoutXAxisAnchor LeadingAnchor { get; }
Property Value
LeftAnchor
Get layout anchor representing the left edge of the view’s frame.
public NSLayoutXAxisAnchor LeftAnchor { get; }
Property Value
NeedsLayout
Get or set whether the view needs a layout pass before it can be drawn.
public bool NeedsLayout { get; set; }
Property Value
RightAnchor
Get layout anchor representing the right edge of the view’s frame.
public NSLayoutXAxisAnchor RightAnchor { get; }
Property Value
SafeAreaInsets
Get distances from the edges of your view that define the safe area.
public NSEdgeInsets SafeAreaInsets { get; }
Property Value
SafeAreaRect
A rectangle in the view’s coordinate system that contains the unobscured portion of the view.
public NSRect SafeAreaRect { get; }
Property Value
SubViews
Get all child views.
public NSArray<NSView> SubViews { get; }
Property Value
SuperView
Get parent view.
public NSView? SuperView { get; }
Property Value
Tag
Get tag of view.
public int Tag { get; }
Property Value
TopAnchor
Get layout anchor representing the top edge of the view’s frame.
public NSLayoutYAxisAnchor TopAnchor { get; }
Property Value
TrailingAnchor
Get layout anchor representing the trailing edge of the view’s frame.
public NSLayoutXAxisAnchor TrailingAnchor { get; }
Property Value
TranslatesAutoresizingMaskIntoConstraints
Get or set whether the view’s autoresizing mask is translated into constraints for the constraint-based layout system.
public bool TranslatesAutoresizingMaskIntoConstraints { get; set; }
Property Value
VisibleRect
Get bounds of view which is not clipped by its super view.
public NSRect VisibleRect { get; }
Property Value
WidthAnchor
Get layout anchor representing the width of the view’s frame.
public NSLayoutDimension WidthAnchor { get; }
Property Value
Window
Get window which contains the view.
public NSWindow? Window { get; }
Property Value
Methods
AddConstraint(NSLayoutConstraint)
Add constraint on the layout of view.
public void AddConstraint(NSLayoutConstraint constraint)
Parameters
constraintNSLayoutConstraintConstraint.
AddConstraints(params NSLayoutConstraint[])
Add multiple constraints on the layout of view.
public void AddConstraints(params NSLayoutConstraint[] constraints)
Parameters
constraintsNSLayoutConstraint[]Constraint.
AddConstraints(NSArray<NSLayoutConstraint>)
Add multiple constraints on the layout of view.
public void AddConstraints(NSArray<NSLayoutConstraint> constraints)
Parameters
constraintsNSArray<NSLayoutConstraint>Constraint.
AddSubView(NSView)
Add given view as sub-view.
public void AddSubView(NSView view)
Parameters
viewNSViewView.
AddSubView(NSView, OrderingMode, NSView?)
Add given view as sub-view.
public void AddSubView(NSView view, NSWindow.OrderingMode place, NSView? otherView)
Parameters
viewNSViewView.
placeNSWindow.OrderingModeRelation to other view.
otherViewNSViewOther view which the sub-view relative to.
Initialize(IntPtr, NSRect)
Initialize NSView with frame.
protected static IntPtr Initialize(IntPtr view, NSRect frame)
Parameters
Returns
InvalidateIntrinsicContentSize()
Invalidate the view’s intrinsic content size.
public void InvalidateIntrinsicContentSize()
Layout()
Perform layout.
public void Layout()
RemoveConstraint(NSLayoutConstraint)
Add constraint from view.
public void RemoveConstraint(NSLayoutConstraint constraint)
Parameters
constraintNSLayoutConstraintConstraint.
RemoveConstraints(params NSLayoutConstraint[])
Add multiple constraints from view.
public void RemoveConstraints(params NSLayoutConstraint[] constraints)
Parameters
constraintsNSLayoutConstraint[]Constraint.
RemoveConstraints(NSArray<NSLayoutConstraint>)
Add multiple constraints from view.
public void RemoveConstraints(NSArray<NSLayoutConstraint> constraints)
Parameters
constraintsNSArray<NSLayoutConstraint>Constraint.
RemoveFromSuperView()
Remove from its super view.
public void RemoveFromSuperView()
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.