Upravit

Sdílet prostřednictvím


UIView Class

Definition

Base class used for components that want to render themselves and respond to events.

[Foundation.Register("UIView", true)]
public class UIView : UIKit.UIResponder, CoreAnimation.ICALayerDelegate, Foundation.INSCoding, IDisposable, System.Collections.IEnumerable, UIKit.IUIAccessibilityIdentification, UIKit.IUIAppearance, UIKit.IUIAppearanceContainer, UIKit.IUICoordinateSpace, UIKit.IUIDynamicItem, UIKit.IUIFocusItem, UIKit.IUIFocusItemContainer, UIKit.IUITraitEnvironment
type UIView = class
    inherit UIResponder
    interface IEnumerable
    interface INSCoding
    interface INativeObject
    interface IDisposable
    interface IUIAccessibilityIdentification
    interface IUIAppearance
    interface IUIAppearanceContainer
    interface IUICoordinateSpace
    interface IUIDynamicItem
    interface IUIFocusEnvironment
    interface IUIFocusItem
    interface IUIFocusItemContainer
    interface IUITraitEnvironment
    interface ICALayerDelegate
Inheritance
Derived
Attributes
Implements

Remarks

The UIView class is a rectangular area on the screen that is responsible for displaying content and handling user interactions with that content. It can also contain other views, allowing the developer to create complex interactive controls. UIView can thus be used as either a standalone control, or as a full screen of content built from many other independent UIViews.

Views have three major responsibilities:

  • Visualization: UIView instances are responsible for displaying their content, typically this is done by implementing a draw method using either N:CoreGraphics, OpenGL or customizing some of their visual properties. Views also have built-in support for animating elements of the view. :
  • Managing Layout and Subviews: UIViews are responsible for managing their layout in response to changes in size and orientation. This includes re-drawing any content they manage, as well as repositioning children views. This is most often in response to size of the UIView. For instance, if a view represents a button, the location of corners would change according to size. Or, if the device was rotated, the view might get resized (or it might resize its child views). :
  • Event Handling: UIViews are a natural place to handle touch events since they are self-contained user interface elements. UIViews subclass the UIResponder class, so they participate both on system events (like motion and actions) as well as being able to process touch events.

    :

Event Handling

UIViews can handle touch events in two ways. Developers use the high-level gesture recognizer API to detect and handle gestures, or roll their own event handling by using the low-level interface that provides detailed touch events as they happen: every time a finger touches the screen or is lifted as well as motion of those fingers. Both are covered below

To cause the UIView to respond to user input by updating its display, developers should call the SetNeedsDisplayInRect(CGRect) or SetNeedsDisplayInRect(CGRect) which will queue a call to the developer's Draw(CGRect) method where the developer has implemented logic to re-render the control with the new state.

Event delivery can be turned off either by setting the UserInteractionEnabled to false or you can disable them temporarily at the application level by calling BeginIgnoringInteractionEvents(). In both cases, events destined for the view are dropped and are not delivered to the views.

Events are disabled while animation are playing back. Devs can change this behavior when using explicit animations by using the UIViewAnimationOptions's AllowUserInteraction flag in the animation.

Event Handling with Gesture Recognizers

Interacting with touch interfaces has lead to a series of common gesture idioms that are used everywhere. Gestures like swiping, panning, long-presses, pinching rotating and tapping. iOS makes the process of detecting these common gesture idioms very easy by providing Gesture Recognizers. These are objects that inherit from the UIGestureRecognizer class and can detect various standard gesture idioms. The built-in recognizers include:

In addition, developers can create their own custom gesture recognizer by subclassing UIGestureRecognizer.

Developers use the recognizer by creating an instance of the specific kind of recognizer that is needed, optionally setting some parameters, and adding it to the view by calling AddGestureRecognizer. It is possible to attach multiple gesture recognizers to a single view.

For example, the following code creates a gesture recognizer that detects a panning gesture and assigns it to myView:

var recognizer = new UIPanGestureRecognizer ((g) => {
  Console.WriteLine ("Panning detected");
  Console.WriteLine ("Gesture recognizer state: {0}", g.State);
});

myView.AddGestureRecognizer (recognizer);

The parameter passed to the lambda (the "g" parameter in the above code) is an instance of the gesture recognizer that detected the gesture. The developr can query the parameters of the recognized query by looking at the properties in the recognizer; the State property contains the recognizer state.

Event Handling with method Overrides

Although Gesture Recognizers provide a high-level and convenient way of capturing many touch events, they do not cover every possibility. For those cases, developers should subclass UIView and override one or more of the following methods inherited from UIResponder:

UIViews by default only handle a single touch event at once. If you want your view to handle multiple touches, you must set the MultipleTouchEnabled to true.

iOS creates a UIEvent object any time a finger touches the screen, moves or is removed from the screen. The UIEvent encapsulates all of the touches that are taking place on the screen at this point, even those that do not belong to this view. In addition to the UIEvent, there is an NSSet containing UITouch objects that represent the state of each finger on the screen for this particular view.

If the application handles touches directly, developers can override the GestureRecognizerShouldBegin(UIGestureRecognizer) method to control whether an associated UIGestureRecognizer should execute or not.

Creating Views

UIViews are typically created by invoking the constructor that takes a frame as its parameter (the frame is of type RectangleF), for example:

var myView = new UIView (new RectangleF (0, 0, 100, 100));

Most subclasses of UIView will provide a constructor that takes the initial frame, just like UIView. The section below on subclassing UIView has more information on how to do this.

The developer should configure the AutoresizingMask property, which determines how the view will be resized when SetNeedsLayout() is invoked or when the geometry of the view container changes (for example, in response to a device rotation).

After creating a view, the developer adds it to a containing view. On the main screen, this could be a UIWindow or it could be the View property of the current UIViewController. This is done using one of the following methods:

Although developers can use the above APIs to add subviews to any UIView, Apple advises against extending existing high-level views by adding subviews to them. Instead developers should use the public API those high-level views expose.

Bounds and Sizes

Each view is created with an initial Frame. The Frame is a RectangleF structure that represents both the size and the initial position for the view. The coordinates for the Frame are used to specify the position relative to its superview.

You can resize and move views around using the frame. Every time you set the frame the view will layout its subviews. If you are purely moving the view, using frame can cause performance issues, as it relays out the view and all its subviews.

The Bounds is the usable frame of the view. Unlike the Frame, the Bounds do not use the container's coordinate space, but instead represent the size in the view's own coordinate space. By default the Bounds location is (0,0).

When the developer updates the Bounds property, it will modify the Frame based on the value of the Center. Developers can also change the position of a view by updating the Center property.

When the P:UIKit.UIView.Bound property is changed, the size of the view is affected relative to the Center property.

Animation

Apple recommends that app developers use the UIViewPropertyAnimator class to implement animations on their UIView objects. Apple also discourages, but has not deprecated, any other animation APIs on the UIView class. Additionally, developers can implement implicit animations for some or all properties by creating a custom views that has a custom Layer property that provides animation actions for animation keys.

Developers can animate changes in the geometry or appearance of a UIView by creating a new UIViewPropertyAnimator, configuring it, and calling its StartAnimation(Double) method. Developers can update the animations (for example, to cancel it) by calling the AddAnimations(Action, nfloat) method while the animation is in progress. The Animate a UIView using UIKit recipe shows how to create an cancel an animation by using the UIViewPropertyAnimator class.

Alternatively, developers can create animations by calling the M:UIKit.UIView.BeginAnimations(string) method, configuring the animation, making the changes to the animatable properties and then completing the transaction by calling CommitAnimations().

After the developer calls M:UIKit.UIView.BeginAnimations(string), they can call the following methods to configure the animation:

The following example shows how to use these methods in a transaction:

UIView.BeginAnimations (null);
UIView.SetAnimationDuration (5);
UIView.SetAnimationCurve (UIViewAnimationCurve.EaseOut);
view.Bounds = new RectangleF (0, 0, 100, 100);
view.Position = new PointF (200, 200);
UIView.CommitAnimations ();

Alternatively, developers can create transactions and set configuration options in the M:UIKit.UIView.Animate* collection of methods. These methods take, in a single call, the delay, the duration, an animation block, and an action to be invoked when the animation completes. However, Apple also discourages the use of these APIs. Their use is shown below:

UIView.Animate (duration, delay, UIViewAnimationOption.Autoreverse,
  delegate {
      view.Bounds = new RectangleF (0, 0, 100, 100);
      view.Position = new PointF (200, 200);
   },
   delegate {
       Console.WriteLine ("Animation completed");
   }
);

The above is the basic set of animations that are directly supported by the UIView class. For finer control over animations, developers can use the N:CoreAnimation API to animate properties on their UI elements. While implicit animation is disabled for the default layer of a UIView, developers can extend the UIView class to create a derived UIView that contain a derived CALayer that handles animation action keys correctly. Developers should note that animated properties that are changed when adding a subview will be animated during the addition if their default value differs from the final value. For example, the "bounds" and "position" keys, if captured and animated, will cause added subviews to animate in from the origin of the screen.

To enable implicit animation, the developer first creates a custom layer that supplies customized animations for the keys or combinations of keys that the layer will handle. The following custom layer example animates the corner radius and transparency for custom views that use it:

public class CustomLayer : CALayer
{
  public CustomLayer(IntPtr ptr) : base(ptr)
  {

  }

  public override CAAnimation AnimationForKey(string key)
  {
      CABasicAnimation animation = CABasicAnimation.FromKeyPath(key);
      animation.From = this.ValueForKey(new NSString(key));
      animation.Duration = 1f;
      return animation;
  }

  override public NSObject ActionForKey(string key)
  {
      if (key == "cornerRadius" || key == "opacity")
      {
          return this.AnimationForKey(key);
      }
      else
      {
          return base.ActionForKey(key);
      }
  }
}

Then, the developer extends UIView, exporting the "layerClass" selector to return a class for the custom layer created above:

public class CustomView : UIView
{
  public CustomView(CGRect r) : base(r)
  {
  }

  [Export("layerClass")]
  public static ObjCRuntime.Class GetLayerClass()
  {
      return new ObjCRuntime.Class(typeof(CustomLayer));
  }
}

Finally, when the property is set, the changed property is animated with the animation properties that were specified by the custom layer:

fadeAndRound = () =>
          {
              redView.Layer.CornerRadius = 40;
              redView.Alpha = 0.5f;
          };

Threading

UIView methods are not thread safe. Developers should avoid configuring or invoking any of the UIView static methods from any thread that is not the main thread. Newer versions of MonoTouch catch these mistakes in Debug builds by throwing an exception. See the CheckForIllegalCrossThreadCalls for more information.

To perform some work in a background thread that must update any of the UIView properties, or to invoke any of the UIView static methods, developers should use either the M:Foundation.NSObject.BeginInvokeOnMainThread() or M:Foundation.NSObject.InvokeOnMainThread() methods. Both methods take a C# delegate or lambda that is invoked on the main thread.

The M:Foundation.NSObject.InvokeOnMainThread() method will invoke the specified delegate method synchronously on the main thread. The M:Foundation.NSObject.BeginInvokeOnMainThread() will queue the action to be executed on the main thread.

Example:

//
// This performs an expensive computation in the background, and then
// updates the main UI when done.
//
void DoSomeWork (UIView view)
{
  double sum = 0;
  for (int i = 0; i < Int32.MaxValue; i++)
      sum += i * i;

  // Now invoke the update on the main UI.
  view.BeginInvokeOnMainThread (delegate {
      view.BackgroundColor = UIColor.Green;
      statusLabel.Text = "Sum is: " + sum;
  });
}

The following example shows a helper method that can be used to run the provided action on the main thread. It is optimized for calling from the main thread already, and avoids a trip to the main loop pump:

static NSObject Invoker = new NSObject();
public static void EnsureInvokedOnMainThread (Action action)
{
    if (NSThread.Current.IsMainThread) {
        action ();
        return;
    }
    Invoker.BeginInvokeOnMainThread (() => action());
}

How to Subclass UIView

Developers will often subclass UIView to provide their own custom views to use. This section discusses the different classes of members that developers would overwrite to create their custom classes.

Initialization

Subclasses of UIView should chain into either the UIView constructor that is initialized with an initial frame (C:UIKit.UIView(System.Drawing.RectangleF)). The following code shows one way to do this:

public class MyView : UIView {
    public MyView (RectangleF frame) : base (frame)
    {
        // Your initialization code goes here
    }
}

In an object that will be deserialized from an archive produced by the UI designer, the developer must chain to the C:UIKit.UIView(Foundation.NSCoder) constructor and flag the constructor as being the one implementing the selector "initWithCoder:", as shown in the code below:

public class MyView : UIView {
    [Export ("initWithCoder:")]
    public MyView (NSCoder coder) : base (coder)
    {
        // Your initialization code goes here
    }
}

By default UIViews will use a CALayer instance for their backing store. The section on "Changing the CALayer" below has both information on how to make this change and a sample.

The developer should initialize child views in the constructor for the parent view.

Custom Drawing

To implement custom drawing code in a view, developers can subclass the UIView and override the Draw(CGRect) method. The drawing code placed in the Draw method can use N:CoreGraphics to draw with. The steps to draw with Core Graphics are:

  • Obtain a reference to the current graphics context.:
  • Set up any desired drawing attributes, such as fill and stroke colors for instance.:
  • Create geometry from Core Graphics primitives.:
  • Draw the geometry.:

For example, the following code shows an implementation of an overridden Draw method that draws a triangle:

public override void Draw (RectangleF rect)
{
    base.Draw (rect);

    var context = UIGraphics.GetCurrentContext ();

    context.SetLineWidth(4);
    UIColor.Red.SetFill ();
    UIColor.Blue.SetStroke ();

    var path = new CGPath ();

    path.AddLines(new PointF[]{
        new PointF(100,200),
        new PointF(160,100), 
        new PointF(220,200)
    });

    path.CloseSubpath();

    context.AddPath(path);		
    context.DrawPath(CGPathDrawingMode.FillStroke);
}

The developer should not call Draw(CGRect) directly. iOS calls it during run loop processing. iOS first calls it the first time through the run loop, and then whenever the view has been marked as needing display with a call to SetNeedsDisplayInRect(CGRect) or SetNeedsDisplayInRect(CGRect).

Core Graphics uses device independent points rather than pixels. This allows drawing code to scale between different resolutions. For example, on a Retina display, 1 point is equivalent to 2 pixels, while on non-Retina displays, 1 point corresponds to 1 pixel.

Printing

UIViews can be printed. The default behavior is for the contents of the UIView as rendered by the Draw(CGRect) method to be printed.

Developers can provide a different rendering for the view when printed by overriding the DrawRect(CGRect, UIViewPrintFormatter) method.

Constraints

To use the constraint-based layout system i(ntroduced with iOS 6.0) in a subclassed view, the developer must respond to the requiresConstraintBasedLayout selector, as shown in the following example:

class MyView : UIView {
    [Export ("requiresConstraintBasedLayout")]
    bool UseNewLayout ()
    {
        return true;
    }
}

To use constraints to layout the subviews of a view, developers must override the UpdateConstraints() method. This method is called before the constraints-based layout is performed.

Constraints-based layout is performed on the alignment rectangle instead of the view's Frame. The alignment rectangle by default is computed as the Frame modified by the AlignmentRectInsets. Developers can change that behavior and provide a custom alignment rectangle by overriding the AlignmentRectForFrame(CGRect) and FrameForAlignmentRect(CGRect) methods.

Layout

The default layout system for UIViews is very simple. UIViews are created with an initial Frame and an AutoresizingMask that determines how the view will be resized in response to changes in the container's boundaries.

Developers should set the default AutoresizingMask property after initialization.

For views the will be a container for other views, developers should configure their AutoresizingMask property. If the layout behavior provided is not sufficient, the developer should override the LayoutSubviews() method. This method is responsible for updating the Frame property of each of the subviews.

For views that change their state in response to some API calls, developers should call the SetNeedsLayout(), instead of laying out the view themselves. The layout event will then be processed the next time the main loop runs. By using this approach, develoers can coalesce multiple changes to the layout in a single pass.

UIViews can implement the SizeThatFits(CGSize) method to report back what is their desired size based on the contents of the view.

Developers can override the SubviewAdded(UIView) and the WillRemoveSubview(UIView) to track when subviews are added or removed to a UIView.

Developers can override the WillMoveToWindow(UIWindow) and the MovedToWindow() to track when views are moved from one UIWindow to another.

Developers can override the WillMoveToSuperview(UIView) and the MovedToSuperview() to track when views are added or removed from a superview.

Constraints Based Layout

A constraints-based layout system was added in iOS 6.0. This system differs from the traditional layout system in that it uses rules (constraints) that describe the relationships between subviews that should be preserved. When views change in size (for example a label is updated) or the size of the container changes (for example, after a rotation), the new positions and sizes for the subviews are computed based on these constraints.

To opt into this system, a subclass of UIView should expose a static method that is exported as "requiresConstraintBasedLayout" and returns true, like this:

class MyView : UIView {
    [Export ("requiresConstraintBasedLayout")]
    static bool RequiresConstraintBasedLayout ()
    {
        return true;
    }
}

Event Handling

When using gesture recognizers, developers can add those directly to the constructor at initialization time.

To perform low-level touch event handling, developers override the TouchesBegan(NSSet, UIEvent), TouchesMoved(NSSet, UIEvent), TouchesEnded(NSSet, UIEvent) and TouchesCancelled(NSSet, UIEvent) methods.

Since iOS 9.0, TouchesMoved(NSSet, UIEvent) events are raised on supported hardware and configurations for changes in user-applied pressure. The Force property of the UITouch object in the touches set argument contains the magnitude of the touch that raised the event. The following example shows a basic use:

if (TraitCollection.ForceTouchCapability == UIForceTouchCapability.Available) {
    UITouch t = touches.AnyObject as UITouch;
    ForceLabel.Text = "Force: " + t.Force.ToString ();
}
else {
    ForceLabel.Text = "Force Not Active";
}

Application developers do not need to call the base methods for any of the above methods if they are overriding UIView directly. But they should call base when deriving from another UIView subclass.

Application developers can control whether a gesture recognizer is activated by overriding the GestureRecognizerShouldBegin(UIGestureRecognizer) method.

Views and CALayers

Each UIView is backed by a N:CoreAnimation Layer (CALayer). A CALayer represents the GPU-backed bitmap that is used to render the view into the screen. Painting into a UIView actually paints into the CALayer.

While the appearance of a UIView can be controlled by setting its Frame, Alpha, BackgroundColor, or by overriding its Draw(CGRect) method, all those properties and functions are in fact modifying the CALayer owned by the view.

The Layer property is a reference to the CALayer owned by the view. Developers change the appearance of the view by modifying the properties of that layer.

For example, modifyng the CornerRadius property of a view's layer change the corner radius of the view:

view.Layer.CornerRadius = 4;

Developers can add drop shadows:

view.Layer.ShadowColor = new CGColor (1, 0, 0);
view.Layer.ShadowOpacity = 1.0f;
view.Layer.ShadowOffset = new SizeF (0, 4);

Developers can also apply a 3D transformation to the layer:

view.Layer.Transform = CATransform3D.MakeRotation ((float)(Math.PI / 2), 1, 1, 1);

This transformation is a full 3D transform, with a perspective element, and is more versatile than UIView's 2D Transform property. The Frame property is no longer useful after a 3D transformation of this kind.

Changing the CALayer

The Layer owned by a view is automatically created and assigned to the view by UIKit and it defaults to be a CALayer instance. You can control the type of layer that is created for a view by responding to the "layerClass" selector in a static method.

Here is an example of a UIView subclass that uses a custom CALayer to do its drawing. This layer, and therefore the view, always displays the color blue:

public class BlueView : UIView
{
    [Export ("layerClass")]
    public static Class GetLayerClass ()
    {
        return new Class (typeof (BlueLayer));
    }

    public override void Draw (RectangleF rect)
    {
        // Do nothing, the Layer will do all the drawing
    }
}

public class BlueLayer : CALayer
{
    public override void DrawInContext (CGContext ctx)
    {
        ctx.SetFillColor (0, 0, 1, 1);
        ctx.FillRect (Bounds);
    }
}

In this example, a new UIView class called "BlueView" is created. It exports a static method called "GetLayerClass" that tells UIKit the type of layer that this view wishes to own. In this example, the BlueView wishes to own a BlueLayer.

It is now up to the BlueLayer to provide the visual representation of the view. It does this by executing CoreGraphics drawing code in its DrawInContext(CGContext) method. This method is very similar to a UIView's Draw method but is used to fill the layer.

Even though the BlueLayer will do all drawing for the BlueView, the view must still override its Draw method. This override should do nothing and is just a signal to UIKit that the Layer will do all the work.

Motion Effects

Motion Effects are a family of effects that can be applied to UIViews in response to external events, typically the device tilt.

Developers can tie to motion effects the same properties that are animatable already. UIKit ships with UIInterpolatingMotionEffect which allows control over a single property in response to a device tilt.

After the developer creates an effect, they attach it to a view by calling the AddMotionEffect(UIMotionEffect) method and remove it by calling the RemoveMotionEffect(UIMotionEffect) method. The MotionEffects property can also be used to query or set a number of motion effects at once.

The developer can also create custom motion effects by subclassing the UIMotionEffect.

Tint Color

Starting with iOS 7, the TintColor property will now propagate to subviews. This allows the developer to set a global tint color, and the color will be passed down to subviews for views that matter. Some UIViews will respond specially based on the TintColor. Developers should also set the TintAdjustmentMode to control the desaturation when some views are no longer active.

View Hierarchies

iOS user interfaces are built from UIView hierarchies. Parent-child relationships determine not only the visual aspects of the UI, but determine how the application responds to touch events and orientation changes.

View relationships may be built programmatically or via XIB files. UIViews may have many Subviews but only one Superview.

The most common way to add subviews is to use AddSubview(UIView), which appends the child view to the list of Subviews. More precise control of ordering during insertion may be done with the InsertSubview(UIView, nint), InsertSubviewAbove(UIView, UIView), and InsertSubviewBelow(UIView, UIView) methods.

The ordering of Subviews may be manipulated with the BringSubviewToFront(UIView), SendSubviewToBack(UIView), and ExchangeSubview(nint, nint) methods.

Focus

On handheld iOS devices, the user interacts directly with screen objects. On tvOS, a remote is used to navigate through the elements on the screen and only one UIView has "focus." Focus-related APIs include:

In addition to CanBecomeFocused returning true, for a UIView to be focused, it must have a Hidden value of false, a UserInteractionEnabled value of true, a Alpha value greater than 0, and it must not be obscured by another UIView.

Constructors

UIView()

Default constructor that initializes a new instance of this class with no parameters.

UIView(CGRect)

Initializes the UIView with the specified frame.

UIView(IntPtr)

A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

UIView(NSCoder)

A constructor that initializes the object from the data stored in the unarchiver object.

UIView(NSObjectFlag)

Constructor to call on derived classes to skip initialization and merely allocate the object.

Properties

AccessibilityActivationPoint

The screen coordinates for the accessibility element.

AccessibilityAssistiveTechnologyFocusedIdentifiers (Inherited from UIResponder)
AccessibilityAttributedHint

An attributed string providing a brief description of the behavior of the accessibility element.

AccessibilityAttributedLabel

A brief attributed string describing the purpose of the UIView.

AccessibilityAttributedValue

An attributed string holding the value of the UIView, when it is different than the AccessibilityAttributedLabel.

AccessibilityCustomActions

Allows methods to be added to AccessibilityCustomActions as accessibility-supporting supplementary actions.

(Inherited from UIResponder)
AccessibilityDragSourceDescriptors (Inherited from UIResponder)
AccessibilityDropPointDescriptors (Inherited from UIResponder)
AccessibilityElementsHidden

Whether the view's accessibility elements are visible.

AccessibilityFrame

The Frame of the accessibility element, in screen coordinates.

AccessibilityHint

A brief description of the action performed by the accessibility element.

AccessibilityIdentifier

Uniquely identifies this for the purposes of accessibility.

AccessibilityIgnoresInvertColors

Gets or sets whether the UIView will invert its colors in response to such an accessibility request.

AccessibilityLabel

A localized identifier for the accessibility element.

AccessibilityLanguage

The BCP 47 language tag of the language used to speak the accessibility element's components.

AccessibilityNavigationStyle

Gets or sets the navigation style.

AccessibilityPath

Allows the accessibility element to be non-rectangular.

AccessibilityTraits

A bitmask of the UIAccessibilityTraits of this.

AccessibilityValue

The value of the accessibility element.

AccessibilityViewIsModal

Whether Voice Over should ignore sibling elements.

AlignmentRectInsets

Adjustments to the Frame for use with Auto Layout.

Alpha

Controls the transparency (alpha) value for the view.

AnimationsEnabled

Specifies whether animations are displayed or not.

AnnouncementDidFinishNotification

Notification constant for AnnouncementDidFinish

AnnouncementNotification

An accessibility notification that an announcement will happen.

Appearance

Strongly-typed property that returns the UIAppearance class for this class.

AssistiveTechnologyKey

The string "UIAccessibilityAssistiveTechnologyKey" which can be used to distinguish accessibility notifications.

AssistiveTouchStatusDidChangeNotification

Notification constant for AssistiveTouchStatusDidChange

AutoresizingMask

A bitmask that specifies how the receiver should resize itself when its super-view's bounds change.

AutosizesSubviews

Specifies whether the receiver should automatically resize its Subviews when the receiver's Bounds change.

BackgroundColor

Sets the background color of the UIView.

BoldTextStatusDidChangeNotification

Notification constant for BoldTextStatusDidChange

BottomAnchor

The NSLayoutYAxisAnchor that defines the bottom of this UIView.

Bounds

The usable frame of the view, specified using the view's own coordinate system.

CanBecomeFirstResponder

Determines whether this UIREsponder is willing to become the first responder.

(Inherited from UIResponder)
CanBecomeFocused

Whether this UIView can become the focused view.

CanResignFirstResponder

Determines whether this UIResponder is willing to give up its first responder status.

(Inherited from UIResponder)
Center

The center of the view, in the container coordinate space.

CenterXAnchor

The NSLayoutXAxisAnchor that defines the X-axis center of this UIView.

CenterYAnchor

The NSLayoutYAxisAnchor that defines the Y-axis center of this UIView.

Class (Inherited from NSObject)
ClassHandle

The handle for this class.

ClearsContextBeforeDrawing

Specifies that the drawing buffer be erased prior to calling DrawRect(CGRect, UIViewPrintFormatter)

ClipsToBounds

Specifies whether the Subviews are confined to the Bounds of the receiver.

ClosedCaptioningStatusDidChangeNotification

Notification constant for ClosedCaptioningStatusDidChange

CollisionBoundingPath

Gets the UIBezierPath to be used for collision detection.

CollisionBoundsType

Gets the UIDynamicItemCollisionBoundsType describing the type of bounds used for collision detected.

Constraints

The constraints used by Auto Layout on this UIView.

ContentMode

Controls how the cached bitmap of a view must be rendered when the view's bounds change.

ContentScaleFactor

The number of device pixels per logical coordinate point.

ContentStretch

Developers should not use this deprecated property. Developers should use 'CreateResizableImage' instead.

CoordinateSpace

Returns the coordinate space implemenation for the UIView.

DarkerSystemColorsStatusDidChangeNotification

Notification constant for DarkerSystemColorsStatusDidChange

DebugDescription

A developer-meaningful description of this object.

(Inherited from NSObject)
Description

Description of the object, the Objective-C version of ToString.

(Inherited from NSObject)
DirectionalLayoutMargins

Gets or sets the layout margins for laying out content that respects the current language direction.

EffectiveUserInterfaceLayoutDirection

Gets the layout direction for arranging the view's contents.

ElementFocusedNotification

Notification constant for ElementFocused

ExclusiveTouch

Restricts the event delivery to this view.

FirstBaselineAnchor

A NSLayoutYAxisAnchor that defines a constraint based on the baseline of the first line of text in this UIView.

Focused

Whether the UIView is the focused view.

FocusedElementKey

A string constant used by accessibility APIs (see FocusedElement(String)) to identify the focused element.

FocusItemContainer

Gets the focus container that provides spatial information to child focus items.

Frame

Coordinates of the view relative to its container.

GestureRecognizers

The array of UIGestureRecognizers for this UIView.

GrayscaleStatusDidChangeNotification

Notification constant for GrayscaleStatusDidChange

GuidedAccessStatusDidChangeNotification

Notification constant for GuidedAccessStatusDidChange

Handle

Handle (pointer) to the unmanaged object representation.

(Inherited from NSObject)
HasAmbiguousLayout

Returns true if the Auto Layout for this UIView is ambiguous.

HearingDevicePairedEarDidChangeNotification

Notification constant for HearingDevicePairedEarDidChange

HeightAnchor

The NSLayoutDimension that defines the height of this UIView.

Hidden

Specifies whether the UIView displays or not.

InheritedAnimationDuration

Static method that returns the currently-active animation's duration, in seconds.

InputAccessoryView

Custom view that can be attached when the object becomes the first responder.

(Inherited from UIResponder)
InputAccessoryViewController

Gets the custom accessory UIInputViewController to display when this UIResponder becomes the first responder.

(Inherited from UIResponder)
InputAssistantItem

Gets the assistant that will be used to configure the shortcut bar.

(Inherited from UIResponder)
InputView

Custom view to display when the object becomes the first responder. Read-only.

(Inherited from UIResponder)
InputViewController

Gets the custom UIInputViewController to display when this UIResponder becomes the first responder.

(Inherited from UIResponder)
InsetsLayoutMarginsFromSafeArea

Gets or sets a Boolean value that controls whether margins are adjusted to always fall within the safe area. Default is true.

Interactions

Gets or sets the current set of interactions.

IntrinsicContentSize

The size of the intrinsic content of the UIView.

InvertColorsStatusDidChangeNotification

Notification constant for InvertColorsStatusDidChange

IsAccessibilityElement

Whether this is an accessibility element.

IsDirectBinding (Inherited from NSObject)
IsFirstResponder

Returns whether this UIResponder is the First Responder.

(Inherited from UIResponder)
IsProxy (Inherited from NSObject)
KeyCommands

The key commands that should trigger action on this UIResponder. Read-only.

(Inherited from UIResponder)
LastBaselineAnchor

A NSLayoutYAxisAnchor that defines a constraint based on the baseline of the first line of text in this UIView.

Layer

The Core Animation layer used for rendering.

LayoutChangedNotification

An accessibility notification indicating that the layout has changed.

LayoutGuides

The UILayoutGuide objects defined for this UIView.

LayoutMargins

Lays out margins.

LayoutMarginsGuide

Defines the margin attributes.

LeadingAnchor

The NSLayoutXAxisAnchor that defines the leading edge of this UIView.

LeftAnchor

The NSLayoutXAxisAnchor that defines the left edge of this UIView.

MaskView

Returns mask view.

MonoAudioStatusDidChangeNotification

Notification constant for MonoAudioStatusDidChange

MotionEffects

Current set of motion effects on this view.

MultipleTouchEnabled

Controls whether the UIView can handle multitouch events.

NextResponder

The next responder on the response chain

(Inherited from UIResponder)
NoIntrinsicMetric

Represents the value associated with the constant UIViewNoIntrinsicMetric

NotificationSwitchControlIdentifier

Notification constant for NotificationSwitchContr

NotificationVoiceOverIdentifier

Notification constant for NotificationVoiceOv

Opaque

Determines whether the view is opaque or not.

PageScrolledNotification

An accessibility notification indicating that the page has scrolled.

ParentFocusEnvironment

Gets the parent focus environment.

PasteConfiguration

The UIPasteConfiguration supported by this object.

(Inherited from UIResponder)
PauseAssistiveTechnologyNotification

Pauses assistive technology notifications.

PreferredFocusedView

Returns the UIView that should actually be focused.

PreferredFocusEnvironments

An array of IUIFocusEnvironments that are recursively searched by the system to find the default focused view.

PreservesSuperviewLayoutMargins

Preserves layout margins for superview.

ReadableContentGuide

An area that can be read by the user with minimal head moving.

ReduceMotionStatusDidChangeNotification

Notification constant for ReduceMotionStatusDidChange

ReduceTransparencyStatusDidChangeNotification

Notification constant for ReduceTransparencyStatusDidChange

RestorationIdentifier

If not null, indicates that the UIView supports state preservation and restoration.

ResumeAssistiveTechnologyNotification

Resumes assistive technology notifications.

RetainCount

Returns the current Objective-C retain count for the object.

(Inherited from NSObject)
RightAnchor

The NSLayoutXAxisAnchor that defines the right edge of this UIView.

SafeAreaInsets

Gets the insets that place the content so that navigation and tab bars, toolbars, and other content does not obscure the view of the content.

SafeAreaLayoutGuide

Gets the layout guide for placing the content so that navigation and tab bars, toolbars, and other content does not obscure the view of the content.

ScreenChangedNotification

An accessibility notification that the screen has changed.

Self (Inherited from NSObject)
SemanticContentAttribute

Specifies whether the UIView should maintain its layout or flip when used with a right-to-left layout.

ShakeToUndoDidChangeNotification

Notification constant for ShakeToUndoDidChange

ShouldGroupAccessibilityChildren

Whether the UIView's children should be grouped for the purposes of voice-over, regardless of their position on the screen.

SpeakScreenStatusDidChangeNotification

Notification constant for SpeakScreenStatusDidChange

SpeakSelectionStatusDidChangeNotification

Notification constant for SpeakSelectionStatusDidChange

SpeechAttributeIpaNotation

Pronunciation hint for text-to-speech, in Internal Phonetic Notation.

SpeechAttributeLanguage

Retrieves the language used during voice-over.

SpeechAttributePitch

Retrieves the pitch used by voice-over.

SpeechAttributePunctuation

Whether punctuation is being pronounced by voice-over.

SpeechAttributeQueueAnnouncement

If "0", the announcement interrupts existing speech. If a string representation of another number, the announcement is queued.

Subviews

An array of UIViews that are contained within this UIView.

Superclass (Inherited from NSObject)
SuperHandle

Handle used to represent the methods in the base class for this NSObject.

(Inherited from NSObject)
Superview

The UIView, if any, that contains this UIView in its Subviews.

SwitchControlStatusDidChangeNotification

Notification constant for SwitchControlStatusDidChange

Tag

An integer that can be used to identify a specific UIView instance.

TextAttributeCustom

An accessibility key that maps to custom string attributes.

TextAttributeHeadingLevel

An accessibility key that maps to an integer between 0 and 6, 0 meaning no heading.

TextInputContextIdentifier

An identifier indicating that this UIResponder should preserve its text input mode information. Read-only.

(Inherited from UIResponder)
TextInputMode

The text input mode for this UIResponder. Read-only.

(Inherited from UIResponder)
TintAdjustmentMode

The tint adjustment applied to this UIView or one of its parent views.

TintColor

A highlight color which should be used to indicate interactive controls.

TopAnchor

The NSLayoutYAxisAnchor that defines the top of this UIView.

TrailingAnchor

The NSLayoutXAxisAnchor that defines the leading edge of this UIView.

TraitAdjustable

An accessibility trait indicating that the underlying value can be adjusted continuously, as with a slider.

TraitAllowsDirectInteraction

An accessibility trait indicating that the user can interact directly with the UIView.

TraitButton

An accessibility trait indicating button-like behavior.

TraitCausesPageTurn

An accessibility trait indicating that the UIView causes a page turn after voice over completes.

TraitCollection

Returns a trait collection.

TraitHeader

An accessibility trait indicating that the UIView is a divider between content sections.

TraitImage

An accessibility trait indicating the view should be treated as an image.

TraitKeyboardKey

An accessibility trait indicating that the UIView should be treated as a keyboard key.

TraitLink

An accessibility trait indicating that the UIView should be treated as a hyperlink.

TraitNone

Indicates that the UIView has no accessibility traits.

TraitNotEnabled

An accessibility trait indicating that the UIView is disabled and does not allow user interaction.

TraitPlaysSound

An accessibility trait indicating the accessibility element should play its sound when the UIView is activated.

TraitSearchField

An accessibility trait indicating that the UIView is a search field.

TraitSelected

An accessibility trait indicating that the UIView is currently selected.

TraitStartsMediaSession

An accessibility trait that starts a media session when the UIView is activated.

TraitStaticText

An accessibility trait indicating that the UIView contains static text.

TraitSummaryElement

An accessibility trait indicating that the UIView contains summary information.

TraitTabBar
TraitUpdatesFrequently

An accessibility trait indicating that the UIView updates frequently.

Transform

The transform of the UIView, relative to the center of its bounds.

TranslatesAutoresizingMaskIntoConstraints

Specifies whether the autoresizing mask should be translated into constraints for Auto Layout.

UILayoutFittingCompressedSize

Represents the value associated with the constant UILayoutFittingCompressedSize

UILayoutFittingExpandedSize

Represents the value associated with the constant UILayoutFittingExpandedSize

UndoManager

The nearest shared NSUndoManager in the responder chain. Read-only.

(Inherited from UIResponder)
UnfocusedElementKey

A string constant used by accessibility APIs (see FocusedElement(String)) to identify the previously focused element.

UserActivity

Action that encapsulates a user activity that is supported by this responder.

(Inherited from UIResponder)
UserInteractionEnabled

Determines whether input events are processed by this view.

ViewForBaselineLayout

Returns the UIView upon which baseline constraints should be applied.

ViewForFirstBaselineLayout

When overridden, allows the app dev to return a subview as the basis for baseline constraints.

ViewForLastBaselineLayout

When overridden, allows the app dev to return a subview as the basis for baseline constraints.

ViewPrintFormatter

Returns a UIViewPrintFormatter appropriate for the UIView.

VoiceOverStatusChanged

An accessibility notification indicating that the status of voice-over has changed.

VoiceOverStatusDidChangeNotification

Notification constant for VoiceOverStatusDidChange

WidthAnchor

The NSLayoutDimension that defines the horizontal extent of this UIView.

Window

The UIWindow of the UIView.

Zone (Inherited from NSObject)

Methods

AccessibilityActivate()

Activates accessibility for this UIView, returning true on success.

AccessibilityDecrement()

Tells the accessibility element to decrement the value of its content.

(Inherited from UIResponder)
AccessibilityElementDidBecomeFocused()

Indicates that an assistive technology has set its focus to this UIResponder.

(Inherited from UIResponder)
AccessibilityElementDidLoseFocus()

Indicates that an assistive technology has changed its focus from this UIResponder.

(Inherited from UIResponder)
AccessibilityElementIsFocused()

Indicates whether an assistive technology is focused on this UIResponder.

(Inherited from UIResponder)
AccessibilityIncrement()

Tells the accessibility element to increment the value of its content.

(Inherited from UIResponder)
AccessibilityPerformEscape()

Tells the accessibility system to dismiss a modal popover or hierarchically-displayed element.

(Inherited from UIResponder)
AccessibilityPerformMagicTap()

Toggles the application-defined "most important state" of the app.

(Inherited from UIResponder)
AccessibilityScroll(UIAccessibilityScrollDirection)

When overridden, allows the accessibility system to perform scrolling.

(Inherited from UIResponder)
ActionForLayer(CALayer, String)

Retrieves the default CAAction identified by that targets .

Add(UIView)

This is an alias for AddSubview(UIView), but uses the Add pattern as it allows C# 3.0 constructs to add subviews after creating the object.

AddConstraint(NSLayoutConstraint)

Adds a constraint to the layout of the receiving view or its subviews.

AddConstraints(NSLayoutConstraint[])

Adds multiple constraints to the layout of the receiving view or its subviews.

AddGestureRecognizer(UIGestureRecognizer)

Adds a gesture recognizer to this view.

AddInteraction(IUIInteraction)

Adds the interaction to the view.

AddKeyframeWithRelativeStartTime(Double, Double, Action)

Adds a single keyframe to an animation.

AddLayoutGuide(UILayoutGuide)

Adds the specified guide, allowing for Autolayout control without creating dummy views.

AddMotionEffect(UIMotionEffect)

Adds the specified motion effect to the view.

AddObserver(NSObject, NSString, NSKeyValueObservingOptions, IntPtr)

Registers an object for being observed externally (using NSString keyPath).   Observed changes are dispatched to the observer’s object ObserveValue(NSString, NSObject, NSDictionary, IntPtr) method.

(Inherited from NSObject)
AddObserver(NSObject, String, NSKeyValueObservingOptions, IntPtr)

Registers an object for being observed externally (using string keyPath).   Observed changes are dispatched to the observer’s object ObserveValue(NSString, NSObject, NSDictionary, IntPtr) method.

(Inherited from NSObject)
AddObserver(NSString, NSKeyValueObservingOptions, Action<NSObservedChange>)

Registers an object for being observed externally using an arbitrary method.

(Inherited from NSObject)
AddObserver(String, NSKeyValueObservingOptions, Action<NSObservedChange>)

Registers an object for being observed externally using an arbitrary method.

(Inherited from NSObject)
AddSubview(UIView)

Adds the specified view as a subview of this view.

AddSubviews(UIView[])

Convenience routine to add various views to a UIView.

AlignmentRectForFrame(CGRect)

Returns a customized alignment rectangle for Auto Layout.

Animate(Double, Action, Action)

Animates the property changes that take place in the specified action and invokes a completion callback when the animation completes.

Animate(Double, Action)

Animates the property changes that take place in the specified action.

Animate(Double, Double, UIViewAnimationOptions, Action, Action)

Invokes animation changes to one or more views by specifying duration, delay, options, and a completion handler.

AnimateAsync(Double, Action)

Animates the property changes that take place in the specified animation as an asynchronous operation.

AnimateKeyframes(Double, Double, UIViewKeyframeAnimationOptions, Action, UICompletionHandler)

Creates an animation action object that is to be used to set up keyframe-based animations for the current view.

AnimateKeyframesAsync(Double, Double, UIViewKeyframeAnimationOptions, Action)

Creates an animation action object that is to be used to set up keyframe-based animations for the current view.

AnimateNotify(Double, Action, UICompletionHandler)

Animates the property changes that take place in the specified action.

AnimateNotify(Double, Double, nfloat, nfloat, UIViewAnimationOptions, Action, UICompletionHandler)

Executes a view animation that uses a timing curve that corresponds to the activity of a physical spring.

AnimateNotify(Double, Double, UIViewAnimationOptions, Action, UICompletionHandler)

Animates the property changes that take place in the specified action and invokes a completion callback when the animation completes.

AnimateNotifyAsync(Double, Action)

Animates the property changes that take place in the specified action and invokes a completion callback when the animation completes.

AnimateNotifyAsync(Double, Double, nfloat, nfloat, UIViewAnimationOptions, Action)

Executes a view animation that uses a timing curve that corresponds to the activity of a physical spring.

AnimateNotifyAsync(Double, Double, UIViewAnimationOptions, Action)

Executes the specified animation as an asynchronous operation.

AppearanceWhenContainedIn(Type[])

Returns a strongly typed UIAppearance for instances of this class when the view is hosted in the specified hierarchy.

AwakeFromNib()

Called after the object has been loaded from the nib file. Overriders must call base.AwakeFromNib().

(Inherited from NSObject)
BecomeFirstResponder()

Request the object to become the first responder.

(Inherited from UIResponder)
BeginAnimations(String, IntPtr)

Indicates the beginning of an animation block

BeginAnimations(String)

Indicates the beginning of an animation block.

BeginInvokeOnMainThread(Action) (Inherited from NSObject)
BeginInvokeOnMainThread(Selector, NSObject)

Invokes asynchrously the specified code on the main UI thread.

(Inherited from NSObject)
Bind(NSString, NSObject, String, NSDictionary) (Inherited from NSObject)
Bind(String, NSObject, String, NSDictionary)
Obsolete.
(Inherited from NSObject)
BindingInfo(String)
Obsolete.
(Inherited from NSObject)
BindingOptionDescriptions(String)
Obsolete.
(Inherited from NSObject)
BindingValueClass(String)
Obsolete.
(Inherited from NSObject)
BringSubviewToFront(UIView)

Moves the specified subview so that it appears in front of other Subviews.

CanPaste(NSItemProvider[])

Gets whether this can accept a paste operation by the .

(Inherited from UIResponder)
CanPerform(Selector, NSObject)

Determines if this UIResponder can perform the specified action. Typically used to probe for editing commands.

(Inherited from UIResponder)
Capture(Boolean)

Performs a screen-capture of the UIView.

CommitAnimations()

Indicates the end of an animation block.

CommitEditing() (Inherited from NSObject)
CommitEditing(NSObject, Selector, IntPtr) (Inherited from NSObject)
ConformsToProtocol(IntPtr)

Invoked to determine if this object implements the specified protocol.

(Inherited from NSObject)
ContentCompressionResistancePriority(UILayoutConstraintAxis)

Returns the resistance of an axis to compression below its intrinsic size.

ContentHuggingPriority(UILayoutConstraintAxis)

Returns the resistance of an axis to expansion larger than its intrinsic size.

ConvertPointFromCoordinateSpace(CGPoint, IUICoordinateSpace)

Converts from the coordinate system to thisUIView object's coordinate system.

ConvertPointFromView(CGPoint, UIView)

Converts from the coordinate system of to this object's coordinate system.

ConvertPointToCoordinateSpace(CGPoint, IUICoordinateSpace)

Converts from this object's coordinate system to that of .

ConvertPointToView(CGPoint, UIView)

Converts from this object's coordinate system to that of .

ConvertRectFromCoordinateSpace(CGRect, IUICoordinateSpace)

Converts from the coordinate system of to that of this object.

ConvertRectFromView(CGRect, UIView)

Converts from the coordinate system used in to that of this object.

ConvertRectToCoordinateSpace(CGRect, IUICoordinateSpace)

Converts from this object's coordinate system to that described by .

ConvertRectToView(CGRect, UIView)

Converts from this object's coordinate system to that of .

Copy()

Performs a copy of the underlying Objective-C object.

(Inherited from NSObject)
Copy(NSObject)

Indicates a "Copy" editing operation.

(Inherited from UIResponder)
Cut(NSObject)

Indicates a "Cut" editing operation.

(Inherited from UIResponder)
DangerousAutorelease() (Inherited from NSObject)
DangerousRelease() (Inherited from NSObject)
DangerousRetain() (Inherited from NSObject)
DecodeRestorableState(NSCoder)

Application developers can override this method to support state restoration.

Delete(NSObject)

Indicates a "Delete" editing operation.

(Inherited from UIResponder)
DidChange(NSKeyValueChange, NSIndexSet, NSString)

Indicates a change occurred to the indexes for a to-many relationship.

(Inherited from NSObject)
DidChange(NSString, NSKeyValueSetMutationKind, NSSet) (Inherited from NSObject)
DidChangeValue(String)

Indicates that a change occurred on the specified key.

(Inherited from NSObject)
DidHintFocusMovement(UIFocusMovementHint)

Called to tell the focused item in the UIView that the focus may change.

DidUpdateFocus(UIFocusUpdateContext, UIFocusAnimationCoordinator)

Called after the UIView has either lost or received focus. (See also ShouldUpdateFocus(UIFocusUpdateContext).)

DisplayLayer(CALayer)
Dispose()

Releases the resources used by the NSObject object.

(Inherited from NSObject)
Dispose(Boolean)

Releases the resources used by the UIView object.

DoesNotRecognizeSelector(Selector)

Indicates that this object does not recognize the specified selector.

(Inherited from NSObject)
Draw(CGRect)

Draws the view within the passed-in rectangle.

DrawLayer(CALayer, CGContext)
DrawRect(CGRect, UIViewPrintFormatter)

Developers should override this method if their appr draws the UIView contents.

DrawViewHierarchy(CGRect, Boolean)

Renders the complete view hierarchy visible on screen.

EncodeRestorableState(NSCoder)

Application developers can override this method to store state associated with the view.

EncodeTo(NSCoder)

Encodes the state of the object on the provided encoder

Equals(NSObject) (Inherited from NSObject)
Equals(Object) (Inherited from NSObject)
ExchangeSubview(nint, nint)

This method exchanges the indices of two UIViews within the Subviews array.

ExerciseAmbiguityInLayout()

Randomly changes the Frame within an ambiguous set of Auto Layout constraints.

ExposedBindings() (Inherited from NSObject)
FrameForAlignmentRect(CGRect)

Returns the frame resulting from applying the alignmentRect to the current Auto Layout constraints.

GestureRecognizerShouldBegin(UIGestureRecognizer)

Determines if the specified gesture recognizers should be allowed to track touch events.

GetAppearance(UITraitCollection, Type[])

Returns an appearance proxy for the specified traits.

GetAppearance(UITraitCollection)

Returns an appearance proxy for the specified traits.

GetAppearance<T>()

Obtains the appearance proxy UIView.UIViewAppearance for the subclass of UIView.

GetAppearance<T>(UITraitCollection, Type[])

Obtains the appearance proxy UIView.UIViewAppearance for the subclass of UIView that has the specified trait collection when the view is hosted in the specified hierarchy.

GetAppearance<T>(UITraitCollection)

Obtains the appearance proxy UIView.UIViewAppearance for the subclass of UIView.

GetBindingInfo(NSString) (Inherited from NSObject)
GetBindingOptionDescriptions(NSString) (Inherited from NSObject)
GetBindingValueClass(NSString) (Inherited from NSObject)
GetConstraintsAffectingLayout(UILayoutConstraintAxis)

Returns the array of NSLayoutConstraint that are affecting the layout of the UIView along the specified axis.

GetDictionaryOfValuesFromKeys(NSString[])

Retrieves the values of the specified keys.

(Inherited from NSObject)
GetEnumerator()

Returns an enumerator that lists all of the subviews in this view

GetFocusItems(CGRect)

Returns a list of all the child focus items within the specified rectangle.

GetHashCode()

Generates a hash code for the current instance.

(Inherited from NSObject)
GetMethodForSelector(Selector) (Inherited from NSObject)
GetNativeField(String)
Obsolete.
(Inherited from NSObject)
GetNativeHash() (Inherited from NSObject)
GetTargetForAction(Selector, NSObject)

Returns the object that responds to an action.

(Inherited from UIResponder)
GetUserInterfaceLayoutDirection(UISemanticContentAttribute, UIUserInterfaceLayoutDirection)

Returns the layout direction for the specified semantic attribute relative to the provided layout direction.

GetUserInterfaceLayoutDirection(UISemanticContentAttribute)

Returns the layout direction for the specified attribute.

HitTest(CGPoint, UIEvent)

The frontmost visible, interaction-enabled UIView containing .

Init() (Inherited from NSObject)
InitializeHandle(IntPtr, String) (Inherited from NSObject)
InitializeHandle(IntPtr) (Inherited from NSObject)
InsertSubview(UIView, nint)

Inserts the specified subview at the specified location as a subview of this view.

InsertSubviewAbove(UIView, UIView)

Inserts the specified view above the siblingSubvie in the view hierarchy

InsertSubviewBelow(UIView, UIView)

Inserts the specified view below the siblingSubview in the view hierarchy.

InvalidateIntrinsicContentSize()

Alerts the Auto Layout system that the intrinsic value of the UIView has changed.

Invoke(Action, Double) (Inherited from NSObject)
Invoke(Action, TimeSpan) (Inherited from NSObject)
InvokeOnMainThread(Action) (Inherited from NSObject)
InvokeOnMainThread(Selector, NSObject)

Invokes synchrously the specified code on the main UI thread.

(Inherited from NSObject)
IsDescendantOfView(UIView)

Returns true if this UIView is in the view's view hierarchy.

IsEqual(NSObject) (Inherited from NSObject)
IsKindOfClass(Class) (Inherited from NSObject)
IsMemberOfClass(Class) (Inherited from NSObject)
LayoutIfNeeded()

Lays out the subviews if needed.

LayoutMarginsDidChange()

Lays out changed subviews

LayoutSublayersOfLayer(CALayer)

Called to indicate that the object's Bounds has changed.

LayoutSubviews()

Lays out subviews.

MakeTextWritingDirectionLeftToRight(NSObject)

Sets the direction in which text is written to be left-to-right.

(Inherited from UIResponder)
MakeTextWritingDirectionRightToLeft(NSObject)

Sets the direction in which text is written to be right-to-left.

(Inherited from UIResponder)
MarkDirty()

Promotes a regular peer object (IsDirectBinding is true) into a toggleref object.

(Inherited from NSObject)
MotionBegan(UIEventSubtype, UIEvent)

Method invoked when a motion (a shake) has started.

(Inherited from UIResponder)
MotionCancelled(UIEventSubtype, UIEvent)

Method invoked if the operating system cancels a motion (shake) event.

(Inherited from UIResponder)
MotionEnded(UIEventSubtype, UIEvent)

Method invoked when a motion (shake) has finished.

(Inherited from UIResponder)
MovedToSuperview()

Indicates the UIView has had its Superview property changed.

MovedToWindow()

Indicates the UIView has had its Window property changed.

MutableCopy()

Creates a mutable copy of the specified NSObject.

(Inherited from NSObject)
NeedsUpdateConstraints()

Indicates that the Auto Layout constraints of the UIView need updating.

ObjectDidEndEditing(NSObject) (Inherited from NSObject)
ObserveValue(NSString, NSObject, NSDictionary, IntPtr)

Indicates that the value at the specified keyPath relative to this object has changed.

(Inherited from NSObject)
Paste(NSItemProvider[])

Called to perform a paste operation from .

(Inherited from UIResponder)
Paste(NSObject)

Indicates a "Paste" editing operation.

(Inherited from UIResponder)
PerformSelector(Selector, NSObject, Double, NSString[]) (Inherited from NSObject)
PerformSelector(Selector, NSObject, Double)

Invokes the selector on the current instance and if the obj is not null, it passes this as its single parameter.

(Inherited from NSObject)
PerformSelector(Selector, NSObject, NSObject) (Inherited from NSObject)
PerformSelector(Selector, NSObject) (Inherited from NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean, NSString[]) (Inherited from NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean) (Inherited from NSObject)
PerformSelector(Selector) (Inherited from NSObject)
PerformSystemAnimation(UISystemAnimation, UIView[], UIViewAnimationOptions, Action, UICompletionHandler)

Performs specified system-provided animation sequence on one or more views, together with user-defined parallel animations.

PerformSystemAnimationAsync(UISystemAnimation, UIView[], UIViewAnimationOptions, Action)

Performs specified system-provided animation sequence on one or more views, together with user-defined parallel animations.

PerformWithoutAnimation(Action)

Applies a set of changes to a view with a guarantee that animations will not be used.

PointInside(CGPoint, UIEvent)

Whether is inside thisUIView object's Bounds.

PrepareForInterfaceBuilder() (Inherited from NSObject)
PressesBegan(NSSet<UIPress>, UIPressesEvent)

Indicates that a physical button has been pressed on a remote or game controller.

(Inherited from UIResponder)
PressesCancelled(NSSet<UIPress>, UIPressesEvent)

Indicates a physical button-press event has been cancelled due to a system event.

(Inherited from UIResponder)
PressesChanged(NSSet<UIPress>, UIPressesEvent)

Indicates that the Force value of the evt has changed.

(Inherited from UIResponder)
PressesEnded(NSSet<UIPress>, UIPressesEvent)

Indicates the ending of a press of a physical button on a remote or game controller.

(Inherited from UIResponder)
ReloadInputViews()

Updates custom input and accessory views when this object is the first responder.

(Inherited from UIResponder)
RemoteControlReceived(UIEvent)

Indicates that a remote-control event was received.

(Inherited from UIResponder)
RemoveConstraint(NSLayoutConstraint)

Removes an Auto Layout constraint from the UIView's Constraints.

RemoveConstraints(NSLayoutConstraint[])

Removes multiple Auto Layout constraints from the UIView's Constraints.

RemoveFromSuperview()

Detaches the UIView from its Superview.

RemoveGestureRecognizer(UIGestureRecognizer)

Removes a gesture recognizer from the UIView's GestureRecognizers.

RemoveInteraction(IUIInteraction)

Removes the interaction from the view.

RemoveLayoutGuide(UILayoutGuide)

Removes guide from the LayoutGuides array.

RemoveMotionEffect(UIMotionEffect)

Removes the specified motion effect to the view.

RemoveObserver(NSObject, NSString, IntPtr)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath and context.

(Inherited from NSObject)
RemoveObserver(NSObject, NSString)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath.

(Inherited from NSObject)
RemoveObserver(NSObject, String, IntPtr)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath and context.

(Inherited from NSObject)
RemoveObserver(NSObject, String)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath.

(Inherited from NSObject)
RequiresConstraintBasedLayout()

Indicates that the UIView uses Auto Layout.

ResignFirstResponder()

Called when this UIResponder has been asked to resign its first responder status.

(Inherited from UIResponder)
ResizableSnapshotView(CGRect, Boolean, UIEdgeInsets)

Efficiently creates a rendering of this object's current appearance within .

RespondsToSelector(Selector)

Whether this object recognizes the specified selector.

(Inherited from NSObject)
RestoreUserActivityState(NSUserActivity)

Restores the state that is necessary for continuance of the specified user activity.

(Inherited from UIResponder)
SafeAreaInsetsDidChange()

Method that is called when the safe area changes.

Select(NSObject)

Indicates a "Select" editing operation.|b

(Inherited from UIResponder)
SelectAll(NSObject)

Indicates a "Select All" editing operation.

(Inherited from UIResponder)
SendSubviewToBack(UIView)

Moves a UIView so that it appears behind all its siblings.

SetAnimationBeginsFromCurrentState(Boolean)

Sets whether the animation transaction will animate from the current view state.

SetAnimationCurve(UIViewAnimationCurve)

Sets the animation curve for this animation transaction.

SetAnimationDelay(Double)

Sets the animation delay for this animation transaction.

SetAnimationDelegate(NSObject)

Allows the app developer to create a custom animation delegate.

SetAnimationDidStopSelector(Selector)

Specifies the selector to be used by a custom animation delegate when animation ends.

SetAnimationDuration(Double)

Sets the duration for this animation transaction.

SetAnimationRepeatAutoreverses(Boolean)

Sets whether this animation transaction will automatically reverse when it completes.

SetAnimationRepeatCount(Single)

Sets the repeat count for this animation transaction.

SetAnimationStartDate(NSDate)

Specifies when the animation should begin.

SetAnimationTransition(UIViewAnimationTransition, UIView, Boolean)

Sets a transition to be used during an animation block.

SetAnimationWillStartSelector(Selector)

Specifies the selector to be used by a custom animation delegate when animation is about to begin.

SetContentCompressionResistancePriority(Single, UILayoutConstraintAxis)

Sets the resistance to compression below the UIView's IntrinsicContentSize.

SetContentHuggingPriority(Single, UILayoutConstraintAxis)

Sets the resistance to expansion beyond the UIView's IntrinsicContentSize.

SetNativeField(String, NSObject)
Obsolete.
(Inherited from NSObject)
SetNeedsDisplay()

Marks the view dirty and queues a redraw operation on it.

SetNeedsDisplayInRect(CGRect)

Marks a region of the view as dirty and queues a redraw operation on that region.

SetNeedsFocusUpdate()

When this is the active focus environment, requests a focus update, which can potentially change the PreferredFocusedView. (See also UpdateFocusIfNeeded().)

SetNeedsLayout()

Sets whether subviews need to be rearranged before displaying.

SetNeedsUpdateConstraints()

Indicates to the Auto Layout system that it must call UpdateConstraints().

SetNilValueForKey(NSString)

Sets the value of the specified key to null.

(Inherited from NSObject)
SetValueForKey(NSObject, NSString)

Sets the value of the property specified by the key to the specified value.

(Inherited from NSObject)
SetValueForKeyPath(IntPtr, NSString)

A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

(Inherited from NSObject)
SetValueForKeyPath(NSObject, NSString)

Sets the value of a property that can be reached using a keypath.

(Inherited from NSObject)
SetValueForUndefinedKey(NSObject, NSString)

Indicates an attempt to write a value to an undefined key. If not overridden, raises an NSUndefinedKeyException.

(Inherited from NSObject)
SetValuesForKeysWithDictionary(NSDictionary)

Sets the values of this NSObject to those in the specified dictionary.

(Inherited from NSObject)
ShouldUpdateFocus(UIFocusUpdateContext)

Called prior to the UIView either losing or receiving focus. If either focus environment returns false, the focus update is canceled.

SizeThatFits(CGSize)

Returns the SizeF that best fits this UIView.

SizeToFit()

Moves and resizes the UIView so that it tightly encloses its Subviews

SnapshotView(Boolean)

Creates a UIView that contains a snapshot image of the current view's contents.

SubviewAdded(UIView)

Tells the view when subviews are added.

SystemLayoutSizeFittingSize(CGSize, Single, Single)

Returns the optimal size for this, based on constraints, and the fitting priority arguments.

SystemLayoutSizeFittingSize(CGSize)

Calculates the smallest or largest size that this UIView can have that satisfies its Auto Layout constraints.

TintColorDidChange()

Called when the TintColor changes, such as when a UIActionSheet is displayed.

ToggleBoldface(NSObject)

Toggles the use of a bold font.

(Inherited from UIResponder)
ToggleItalics(NSObject)

Toggles the use of an italic font.

(Inherited from UIResponder)
ToggleUnderline(NSObject)

Toggles the use of underlining.

(Inherited from UIResponder)
ToString()

Returns a string representation of the value of the current instance.

(Inherited from NSObject)
TouchesBegan(NSSet, UIEvent)

Sent when one or more fingers touches the screen.

(Inherited from UIResponder)
TouchesCancelled(NSSet, UIEvent)

Sent when the touch processing has been cancelled.

(Inherited from UIResponder)
TouchesEnded(NSSet, UIEvent)

Sent when one or more fingers are lifted from the screen.

(Inherited from UIResponder)
TouchesEstimatedPropertiesUpdated(NSSet)

Called when the estimated properties of touches have been updated.

(Inherited from UIResponder)
TouchesMoved(NSSet, UIEvent)

Sent when one or more fingers move on the screen.

(Inherited from UIResponder)
TraitCollectionDidChange(UITraitCollection)

Defines previous trait collection.

Transition(UIView, Double, UIViewAnimationOptions, Action, Action)

Specifies a transition animation on the specified collection view.

Transition(UIView, UIView, Double, UIViewAnimationOptions, Action)

Specifies a transition animation on the specified collection view.

TransitionNotify(UIView, Double, UIViewAnimationOptions, Action, UICompletionHandler)

Creates a transition animation action that is used for the current container view.

TransitionNotify(UIView, UIView, Double, UIViewAnimationOptions, UICompletionHandler)

Specifies a transition animation to be used between the specified UIViews.

TransitionNotifyAsync(UIView, Double, UIViewAnimationOptions, Action)

Creates a transition animation action that is used for the current container view.

TransitionNotifyAsync(UIView, UIView, Double, UIViewAnimationOptions)

Specifies a transition animation to be used between the specified UIViews.

Unbind(NSString) (Inherited from NSObject)
Unbind(String)
Obsolete.
(Inherited from NSObject)
UpdateConstraints()

Updates the Auto Layout constraints for the UIView.

UpdateConstraintsIfNeeded()

Updates the constraints of the UIView and its Subviews.

UpdateFocusIfNeeded()

If any focus environment has a pending update, this method forces an immediate focus update. Unlike SetNeedsFocusUpdate(), this method may be called by any UIView, whether it currently contains focus or not.

UpdateUserActivityState(NSUserActivity)

Updates a given user activity state.

(Inherited from UIResponder)
ValueForKey(NSString)

Returns the value of the property associated with the specified key.

(Inherited from NSObject)
ValueForKeyPath(NSString)

Returns the value of a property that can be reached using a keypath.

(Inherited from NSObject)
ValueForUndefinedKey(NSString)

Indicates an attempt to read a value of an undefined key. If not overridden, raises an NSUndefinedKeyException.

(Inherited from NSObject)
ViewWithTag(nint)

Returns the UIView identified by the tag. May return null.

WillChange(NSKeyValueChange, NSIndexSet, NSString)

Indicates that the values of the specified indices in the specified key are about to change.

(Inherited from NSObject)
WillChange(NSString, NSKeyValueSetMutationKind, NSSet) (Inherited from NSObject)
WillChangeValue(String)

Indicates that the value of the specified key is about to change.

(Inherited from NSObject)
WillDrawLayer(CALayer)

Called shortly before the is drawn.

WillMoveToSuperview(UIView)

Called before the Superview changes.

WillMoveToWindow(UIWindow)

This method is called by the runtime when assigning a new UIWindow to the UIView's view hierarcy. This method will be called on all UIViews in the hierarchy, not just the top-level UIView.

WillRemoveSubview(UIView)

Called prior to the removal of a subview.

Events

AnimationWillEnd

This event is raised when the animations will end.

AnimationWillStart

This event is raised when the animations will start.

Extension Methods

ActionForLayer(ICALayerDelegate, CALayer, String)
DisplayLayer(ICALayerDelegate, CALayer)
DrawLayer(ICALayerDelegate, CALayer, CGContext)
LayoutSublayersOfLayer(ICALayerDelegate, CALayer)
WillDrawLayer(ICALayerDelegate, CALayer)

Method that is called when layer is about to be drawn.

GetDebugDescription(INSObjectProtocol)
GetAccessibilityCustomRotors(NSObject)

Gets the array of UIAccessibilityCustomRotor objects appropriate for this object.

SetAccessibilityCustomRotors(NSObject, UIAccessibilityCustomRotor[])

Sets the array of UIAccessibilityCustomRotor objects appropriate for this object.

GetCollisionBoundingPath(IUIDynamicItem)

Returns the closed path that is used for collision detection.

GetCollisionBoundsType(IUIDynamicItem)

Returns a value that tells how collision bounds are specified.

GetFocusItemContainer(IUIFocusEnvironment)

Gets the focus container for the environment.

GetParentFocusEnvironment(IUIFocusEnvironment)

Gets the parent focus environment.

GetPreferredFocusEnvironments(IUIFocusEnvironment)

Gets the list of focus environments, ordered by priority, that the environment prefers when updating the focus.

DidHintFocusMovement(IUIFocusItem, UIFocusMovementHint)

Called when a focus change may soon happen.

GetFrame(IUIFocusItem)

Returns the frame in the reference coordinate space of the containing IUIFocusItemContainer.

CanPaste(IUIPasteConfigurationSupporting, NSItemProvider[])

Returns true if the responder can paste from the specified item providers.

Paste(IUIPasteConfigurationSupporting, NSItemProvider[])

Performs the paste.

DecreaseSize(UIResponder, NSObject)

A hardware keyboard request (Command-minus) to decrease the size of the UIResponder.

IncreaseSize(UIResponder, NSObject)

A hardware keyboard request (Command-plus) to increase the size of the UIResponder.

EndEditing(UIView, Boolean)

Applies to

See also