Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
UIAlertView: Difference between revisions - iPhone Development Wiki

UIAlertView: Difference between revisions

From iPhone Development Wiki
(Created page with 'UIAlertView is a class to display alert messages on screen. == Showing with Undo dialog animation == {{function signature |signature=-(void)showWithAnimationType:(int)type;…')
 
m (subtitle & tagline.)
Line 27: Line 27:


You can create multiple text fields using the -addTextFieldWithValue:label: method. If you only need 1 text field, using the -textField method will automatically create only 1 for you. When the alert view has text fields, it will only be available in portrait position.
You can create multiple text fields using the -addTextFieldWithValue:label: method. If you only need 1 text field, using the -textField method will automatically create only 1 for you. When the alert view has text fields, it will only be available in portrait position.
== Subtitle and tagline ==
[[Image:Screenshot_2009.12.04_23.16.46.png|thumb|right|How subtitle and tagline look like.]]
{{function signature|signature=@property(nonatomic,copy) NSString* subtitle;|firmware=2.0 –}}
{{function signature|signature=-(void)setTaglineText:(NSString*)taglineText|firmware=2.0 –}}
Subtitle and tagline are two additional styles of text which you could place on an alert view. Subtitle appears below the title, and tagline appears below the message.


== References ==
== References ==
* Official reference: {{sdklink|UIKit|UIAlertView}}
* Official reference: {{sdklink|UIKit|UIAlertView}}
{{IPFHeader|UIKit}}
{{IPFHeader|UIKit}}

Revision as of 15:29, 4 December 2009

UIAlertView is a class to display alert messages on screen.

Showing with Undo dialog animation

Signature -(void)showWithAnimationType:(int)type;
Available in 3.0 –

Unlike all other dialogs which pops up, the Undo dialog appears by jiggling in from the side. You can do so with [alert showWithAnimationType:1].

Adding text fields

Signature -(UIAlertSheetTextField*)addTextFieldWithValue:(NSString*)defaultText label:(NSString*)promptText;
Available in 2.0 –
Signature -(UIAlertSheetTextField*)textFieldAtIndex:(NSInteger)index;
Available in 2.0 –
Signature -(UIAlertSheetTextField*)textField;
Available in 2.0 –
Signature -(NSInteger)textFieldCount;
Available in 2.0 –

You can create multiple text fields using the -addTextFieldWithValue:label: method. If you only need 1 text field, using the -textField method will automatically create only 1 for you. When the alert view has text fields, it will only be available in portrait position.

Subtitle and tagline

How subtitle and tagline look like.
Signature @property(nonatomic,copy) NSString* subtitle;
Available in 2.0 –
Signature -(void)setTaglineText:(NSString*)taglineText
Available in 2.0 –

Subtitle and tagline are two additional styles of text which you could place on an alert view. Subtitle appears below the title, and tagline appears below the message.

References