UIAlertView
生活随笔
收集整理的這篇文章主要介紹了
UIAlertView
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一.
UIAlertView(警報)以藍色圓角矩形都形式出現在屏幕的中部,警報可顯示一個或多個按鈕。
? -?(void)viewDidLoad?{
????????UIAlertView?*alert?=?[[UIAlertView?alloc]????????initWithTitle:@”Hello”
????????message:@”This?is?an?alert?view”
????????delegate:self
????????cancelButtonTitle:@”OK”
????????otherButtonTitles:nil];
????????[alert?show];
????????[alert?release];
????????[super?viewDidLoad];
}
?
?
?二.
?
?#import?<UIKit/UIKit.h>
@interface?UsingViewsViewController?:?UIViewController????????<UIAlertViewDelegate>?{
}
@end
?
?-?(void)viewDidLoad?{
????UIAlertView?*alert?=?[[UIAlertView?alloc]????initWithTitle:@”Hello”
????message:@”This?is?an?alert?view”
????delegate:self
????cancelButtonTitle:@”OK”
????otherButtonTitles:@”Option?1”,?@”Option?2”,?nil];
????[alert?show];
????[alert?release];
????[super?viewDidLoad];
}
?
?
?
?-?(void)alertView:(UIAlertView?*)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex?{????NSLog(@”%d”,?buttonIndex);
}
?
?OK button — 0
Option 1 — 1Option 2 — 2?
?
?
?
?
?
轉載于:https://www.cnblogs.com/zjz008/archive/2011/05/23/2054704.html
總結
以上是生活随笔為你收集整理的UIAlertView的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微软CRM 2011 新功能之三:可新增
- 下一篇: 五分钟使你的Firefox快两倍