<span id="Label3"></p>first, the method of initialization<p><p>-(instancetype) initwithtitle: (nsstring *) title delegate: (id<uiactionsheetdelegate>) Delegate Cancelbuttontitle: (nsstring *) cancelbuttontitle destructivebuttontitle: (nsstring *) destructivebuttontitle Otherbuttontitles: (nsstring *) otherbuttontitles, ...;</p></p><p><p></p></p><p><p>Parameter description:</p></p><p><p>Title: View Title</p></p><p><p>Delegate: Setting up the agent</p></p><p><p>Cancelbuttontitle: the title of the Cancel button</p></p><p><p>Destructivebuttontitle: title of the special tagged button</p></p><p><p>Otherbuttontitles: Title of other buttons</p></p>Introduction of common methods and properties<p><p></p></p><p><p>@property (nonatomic,copy) NSString *title;</p></p><p><p>Set Title</p></p><p><p></p></p><p><p>@property (nonatomic) Uiactionsheetstyle actionsheetstyle;</p></p><p><p>To set the style, enumerate the following:</p></p>? <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="gutter">123456 </td> <td class="code"><code class="cpp keyword bold">typedef </code> < Code class= "cpp plain" >ns_enum (nsinteger, uiactionsheetstyle) { <code class="cpp spaces"> </code> <code class="cpp plain">uiactionsheetstyleautomatic = -1, </code> <code class="cpp spaces"> </code> <code class="cpp plain">uiactionsheetstyledefault = uibarstyledefault, </code> <code class="cpp spaces"> </code> Code class= "cpp plain" >uiactionsheetstyleblacktranslucent = uibarstyleblacktranslucent, <code class="cpp spaces"> </code> <code class="cpp plain">uiactionsheetstyleblackopaque = uibarstyleblackopaque, </code> <code class="cpp plain">}; </code> </td> </tr> </tbody> </table><p><p></p></p><p><p>-(nsinteger) addbuttonwithtitle: (nsstring *) title;</p></p><p><p>Add a button that returns the index of the button</p></p><p><p></p></p><p><p>-(nsstring *) buttontitleatindex: (nsinteger) buttonindex;</p></p><p><p>Get button title</p></p><p><p></p></p><p><p>@property (nonatomic,readonly) Nsinteger numberofbuttons;</p></p><p><p>Get the number of buttons</p></p><p><p>@property (nonatomic) Nsinteger cancelbuttonindex;</p></p><p><p>Set the index value of the Cancel button</p></p><p><p></p></p><p><p>@property (nonatomic) Nsinteger destructivebuttonindex;</p></p><p><p>Set Special tags</p></p><p><p></p></p><p><p>@property (nonatomic,readonly,getter=isvisible) BOOL visible;</p></p><p><p>Whether the view is currently visible</p></p><p><p></p></p><p><p>Here are a few pop-up methods that show different ways depending on style</p></p><p><p>-(void) showfromtoolbar: (uitoolbar *) view;</p></p><p><p>-(void) showfromtabbar: (uitabbar *) view;</p></p><p><p>-(void) showfrombarbuttonitem: (uibarbuttonitem *) item animated: (BOOL) animated;</p></p><p><p>-(void) showfromrect: (cgrect) rect inview: (UIView *) view animated: (BOOL) animated;</p></p><p><p>-(void) showinview: (UIView *) view;</p></p><p><p></p></p><p><p></p></p><p><p>-(void) dismisswithclickedbuttonindex: (nsinteger) buttonindex animated: (BOOL) animated;</p></p><p><p>Use code to retract a view</p></p>three, Uiactionsheet Agent Method<p><p></p></p><p><p>-(void) actionsheet: (uiactionsheet *) actionsheet clickedbuttonatindex: (nsinteger) buttonindex;</p></p><p><p>How to trigger when a button is clicked</p></p><p><p></p></p><p><p>-(void) willpresentactionsheet: (uiactionsheet *) actionsheet;</p></p><p><p>The method that fires when the view is about to pop up</p></p><p><p></p></p><p><p>-(void) didpresentactionsheet: (uiactionsheet *) actionsheet;</p></p><p><p>How the view has been triggered by pop-up</p></p><p><p></p></p><p><p>-(void) actionsheet: (uiactionsheet *) actionsheet willdismisswithbuttonindex: (nsinteger) buttonindex;</p></p><p><p>The method that fires when the view is retracted when the button is clicked</p></p><p><p></p></p><p><p>-(void) actionsheet: (uiactionsheet *) actionsheet diddismisswithbuttonindex: (nsinteger) buttonindex;</p></p><p><p>Method triggered when the view has been retracted when the button is clicked</p></p><p><p>How to use Uiactionsheet in iOS</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service