UIAlertView Class
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.
A UIView that displays a dialog message with one or more buttons. (As of iOS 8, devs should use UIAlertController rather than this class.)
[Foundation.Register("UIAlertView", true)]
public class UIAlertView : UIKit.UIView, IDisposable
[<Foundation.Register("UIAlertView", true)>]
type UIAlertView = class
inherit UIView
interface INSCoding
interface INativeObject
interface IDisposable
- Inheritance
- Attributes
- Implements
Remarks
As of iOS 8, app devs should use UIAlertController rather than this class. Extensions may not use this class at all.
The UIAlertView allows the application user to choose among alternative actions. The following code and image, taken from the "AlertViews" section of the "ios Standard Controls" sample illustrates the simplest use-case:
var alert = new UIAlertView () {
Title = "alert title",
Message = "this is a simple alert"
};
alert.AddButton ("OK");
alert.Show ();
An alternative to the UIAlertView is the UIActionSheet.
The application developer can use UIAlertViewStyles such as PlainTextInput or LoginAndPasswordInput to allow the application user to enter values.
This class should not be subclassed.
Constructors
| Name | Description |
|---|---|
| UIAlertView() |
Creates a new UIAlertView with default values. |
| UIAlertView(CGRect) | |
| UIAlertView(NativeHandle) |
A constructor used when creating managed representations of unmanaged objects. Called by the runtime. |
| UIAlertView(NSCoder) |
A constructor that initializes the object from the data stored in the unarchiver object. |
| UIAlertView(NSObjectFlag) |
Constructor to call on derived classes to skip initialization and merely allocate the object. |
| UIAlertView(String, String, IUIAlertViewDelegate, String, String[]) |
Constructor to initialize an alert view. |
Properties
| Name | Description |
|---|---|
| AccessibilityActivationPoint | (Inherited from UIView) |
| AccessibilityAssistiveTechnologyFocusedIdentifiers | (Inherited from UIResponder) |
| AccessibilityAttributedHint | (Inherited from UIView) |
| AccessibilityAttributedLabel | (Inherited from UIView) |
| AccessibilityAttributedUserInputLabels | (Inherited from UIView) |
| AccessibilityAttributedValue | (Inherited from UIView) |
| AccessibilityCustomActions | (Inherited from UIResponder) |
| AccessibilityDirectTouchOptions | (Inherited from UIView) |
| AccessibilityDragSourceDescriptors | (Inherited from UIResponder) |
| AccessibilityDropPointDescriptors | (Inherited from UIResponder) |
| AccessibilityElementsHidden | (Inherited from UIView) |
| AccessibilityExpandedStatus | (Inherited from UIView) |
| AccessibilityFrame | (Inherited from UIView) |
| AccessibilityHint | (Inherited from UIView) |
| AccessibilityIdentifier |
Uniquely identifies |
| AccessibilityIgnoresInvertColors | (Inherited from UIView) |
| AccessibilityLabel | (Inherited from UIView) |
| AccessibilityLanguage | (Inherited from UIView) |
| AccessibilityNavigationStyle | (Inherited from UIView) |
| AccessibilityPath | (Inherited from UIView) |
| AccessibilityRespondsToUserInteraction | (Inherited from UIView) |
| AccessibilityTextualContext | (Inherited from UIView) |
| AccessibilityTraits | (Inherited from UIView) |
| AccessibilityUserInputLabels | (Inherited from UIView) |
| AccessibilityValue | (Inherited from UIView) |
| AccessibilityViewIsModal | (Inherited from UIView) |
| ActivityItemsConfiguration | (Inherited from UIResponder) |
| AlertViewStyle | |
| AlignmentRectInsets | (Inherited from UIView) |
| Alpha | (Inherited from UIView) |
| AnchorPoint | (Inherited from UIView) |
| Appearance |
Strongly-typed property that returns the UIAppearance class for this class. |
| AppliedContentSizeCategoryLimitsDescription | (Inherited from UIView) |
| AutoresizingMask | (Inherited from UIView) |
| AutosizesSubviews | (Inherited from UIView) |
| BackgroundColor |
The color used for the background. (Inherited from UIView) |
| BottomAnchor | (Inherited from UIView) |
| Bounds | (Inherited from UIView) |
| ButtonCount | |
| CanBecomeFirstResponder | (Inherited from UIResponder) |
| CanBecomeFocused | (Inherited from UIView) |
| CancelButtonIndex | |
| CanResignFirstResponder | (Inherited from UIResponder) |
| Center | (Inherited from UIView) |
| CenterXAnchor | (Inherited from UIView) |
| CenterYAnchor | (Inherited from UIView) |
| Class | (Inherited from NSObject) |
| ClassHandle |
The Objective-C class handle for this class. |
| ClearsContextBeforeDrawing | (Inherited from UIView) |
| ClipsToBounds | (Inherited from UIView) |
| CollisionBoundingPath |
Returns the closed path that is used for collision detection. (Inherited from UIView) |
| CollisionBoundsType |
Returns a value that tells how collision bounds are specified. (Inherited from UIView) |
| Constraints | (Inherited from UIView) |
| ContentMode | (Inherited from UIView) |
| ContentScaleFactor | (Inherited from UIView) |
| ContentStretch | (Inherited from UIView) |
| CoordinateSpace |
Gets the coordinate space implemenation. (Inherited from UIView) |
| CornerConfiguration | (Inherited from UIView) |
| DebugDescription | (Inherited from NSObject) |
| Delegate |
An instance of the UIKit.IUIAlertViewDelegate model class which acts as the class delegate. |
| Description | (Inherited from NSObject) |
| DirectionalLayoutMargins | (Inherited from UIView) |
| EditingInteractionConfiguration | (Inherited from UIResponder) |
| EffectiveUserInterfaceLayoutDirection | (Inherited from UIView) |
| ExclusiveTouch |
Restricts the event delivery to this view. (Inherited from UIView) |
| FirstBaselineAnchor | (Inherited from UIView) |
| FirstOtherButtonIndex | |
| Focused |
Whether the UIView is the focused view. (Inherited from UIView) |
| FocusEffect | (Inherited from UIView) |
| FocusGroupIdentifier | (Inherited from UIView) |
| FocusGroupPriority | (Inherited from UIView) |
| FocusItemContainer |
Gets the container that manages focus information for child focus items. (Inherited from UIView) |
| FocusItemDeferralMode | (Inherited from UIView) |
| Frame | (Inherited from UIView) |
| GestureRecognizers | (Inherited from UIView) |
| Handle |
Handle (pointer) to the unmanaged object representation. (Inherited from NSObject) |
| HasAmbiguousLayout | (Inherited from UIView) |
| HeightAnchor | (Inherited from UIView) |
| Hidden |
Specifies whether the UIView displays or not. (Inherited from UIView) |
| HoverStyle | (Inherited from UIView) |
| InputAccessoryView | (Inherited from UIResponder) |
| InputAccessoryViewController | (Inherited from UIResponder) |
| InputAssistantItem | (Inherited from UIResponder) |
| InputView | (Inherited from UIResponder) |
| InputViewController | (Inherited from UIResponder) |
| InsetsLayoutMarginsFromSafeArea | (Inherited from UIView) |
| Interactions | (Inherited from UIView) |
| IntrinsicContentSize | (Inherited from UIView) |
| IsAccessibilityElement | (Inherited from UIView) |
| IsDirectBinding | (Inherited from NSObject) |
| IsFirstResponder | (Inherited from UIResponder) |
| IsProxy | (Inherited from NSObject) |
| IsTransparentFocusItem | (Inherited from UIView) |
| KeyboardLayoutGuide | (Inherited from UIView) |
| KeyCommands | (Inherited from UIResponder) |
| LargeContentImage | (Inherited from UIView) |
| LargeContentImageInsets | (Inherited from UIView) |
| LargeContentTitle | (Inherited from UIView) |
| LastBaselineAnchor | (Inherited from UIView) |
| Layer | (Inherited from UIView) |
| LayoutGuides | (Inherited from UIView) |
| LayoutMargins | (Inherited from UIView) |
| LayoutMarginsGuide | (Inherited from UIView) |
| LeadingAnchor | (Inherited from UIView) |
| LeftAnchor | (Inherited from UIView) |
| MaskView | (Inherited from UIView) |
| MaximumContentSizeCategory | (Inherited from UIView) |
| Message | |
| MinimumContentSizeCategory | (Inherited from UIView) |
| MotionEffects | (Inherited from UIView) |
| MultipleTouchEnabled |
Controls whether the UIView can handle multitouch events. (Inherited from UIView) |
| NextResponder | (Inherited from UIResponder) |
| Opaque |
Determines whether the view is opaque or not. (Inherited from UIView) |
| OverrideUserInterfaceStyle | (Inherited from UIView) |
| ParentFocusEnvironment |
Gets the parent focus environment. (Inherited from UIView) |
| PasteConfiguration |
The UIPasteConfiguration supported by |
| PreferredFocusedView |
If not |
| PreferredFocusEnvironments |
Gets the list of focus environments, ordered by priority, that the environment prefers when updating the focus. (Inherited from UIView) |
| PreservesSuperviewLayoutMargins | (Inherited from UIView) |
| ReadableContentGuide | (Inherited from UIView) |
| RestorationIdentifier | (Inherited from UIView) |
| RetainCount | (Inherited from NSObject) |
| RightAnchor | (Inherited from UIView) |
| SafeAreaInsets | (Inherited from UIView) |
| SafeAreaLayoutGuide | (Inherited from UIView) |
| ScalesLargeContentImage | (Inherited from UIView) |
| Self | (Inherited from NSObject) |
| SemanticContentAttribute | (Inherited from UIView) |
| ShouldEnableFirstOtherButton |
Delegate invoked by the object to get a value. |
| ShouldGroupAccessibilityChildren | (Inherited from UIView) |
| ShowsLargeContentViewer | (Inherited from UIView) |
| Subviews | (Inherited from UIView) |
| Superclass | (Inherited from NSObject) |
| SuperHandle |
Handle used to represent the methods in the base class for this NSObject. (Inherited from NSObject) |
| Superview | (Inherited from UIView) |
| Tag | (Inherited from UIView) |
| TextInputContextIdentifier | (Inherited from UIResponder) |
| TextInputMode | (Inherited from UIResponder) |
| TintAdjustmentMode | (Inherited from UIView) |
| TintColor |
The color used for tinting. (Inherited from UIView) |
| Title | |
| TopAnchor | (Inherited from UIView) |
| TouchBar | (Inherited from UIResponder) |
| TrailingAnchor | (Inherited from UIView) |
| TraitCollection |
Gets the trait collection that describes the environment. (Inherited from UIView) |
| TraitOverrides | (Inherited from UIView) |
| Transform | (Inherited from UIView) |
| Transform3D | (Inherited from UIView) |
| TranslatesAutoresizingMaskIntoConstraints | (Inherited from UIView) |
| UndoManager | (Inherited from UIResponder) |
| UserActivity | (Inherited from UIResponder) |
| UserInteractionEnabled |
Determines whether input events are processed by this view. (Inherited from UIView) |
| ViewForBaselineLayout | (Inherited from UIView) |
| ViewForFirstBaselineLayout | (Inherited from UIView) |
| ViewForLastBaselineLayout | (Inherited from UIView) |
| ViewPrintFormatter | (Inherited from UIView) |
| Visible |
Used to determine if the alert view is currently being displayed. |
| WeakDelegate | |
| WidthAnchor | (Inherited from UIView) |
| Window | (Inherited from UIView) |
| Zone | (Inherited from NSObject) |
Methods
Events
| Name | Description |
|---|---|
| Canceled |
Event raised by the object. |
| Clicked |
Event raised by the object. |
| Dismissed |
Event raised by the object. |
| Presented |
Event raised by the object. |
| WillDismiss |
Event raised by the object. |
| WillPresent |
Event raised by the object. |