UIActionSheet 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 an action sheet with one or more buttons. (As of iOS 8, devs should use UIAlertController rather than this class.)
[Foundation.Register("UIActionSheet", true)]
public class UIActionSheet : UIKit.UIView, System.Collections.IEnumerable
[<Foundation.Register("UIActionSheet", true)>]
type UIActionSheet = class
inherit UIView
interface IEnumerable
- 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 UIActionSheet control is a convenient way to allow the application user to choose among alternative actions. The following code and diagram are taken from the "Action Sheets" section of the "iOS Standard Controls" sample.
protected void HandleBtnActionSheetWithOtherButtonsTouchUpInside (object sender, EventArgs e)
{
actionSheet = new UIActionSheet ("action sheet with other buttons");
actionSheet.AddButton ("delete");
actionSheet.AddButton ("cancel");
actionSheet.AddButton ("a different option!");
actionSheet.AddButton ("another option");
actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 1;
//actionSheet.FirstOtherButtonIndex = 2;
actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked");
};
actionSheet.ShowInView (View);
}

Constructors
| Name | Description |
|---|---|
| UIActionSheet() |
Creates a new UIActionSheet with default values. |
| UIActionSheet(CGRect) | |
| UIActionSheet(NativeHandle) |
A constructor used when creating managed representations of unmanaged objects. Called by the runtime. |
| UIActionSheet(NSCoder) |
A constructor that initializes the object from the data stored in the unarchiver object. |
| UIActionSheet(NSObjectFlag) |
Constructor to call on derived classes to skip initialization and merely allocate the object. |
| UIActionSheet(String, IUIActionSheetDelegate, String, String, String[]) |
Initializes a UIActionSheet instance. |
| UIActionSheet(String, IUIActionSheetDelegate) |
Initialize a UIActionSheet with a title and a delegate that will handle taps. |
| UIActionSheet(String) |
Initialize an UIActionSheet with a title. |
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) |
| 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.IUIActionSheetDelegate model class which acts as the class delegate. |
| Description | (Inherited from NSObject) |
| DestructiveButtonIndex | |
| 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) |
| 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) |
| ShouldGroupAccessibilityChildren | (Inherited from UIView) |
| ShowsLargeContentViewer | (Inherited from UIView) |
| Style | |
| 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 |
A property indicating if the action sheet is 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. |