iphone开发学习,UIAlertView的简单改写,popAlertView
生活随笔
收集整理的這篇文章主要介紹了
iphone开发学习,UIAlertView的简单改写,popAlertView
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
改寫的AlertView,有彈出效果,點擊任意位置關(guān)閉View。
效果圖:
- (IBAction)didPressedClick:(id)sender{alert = [[UIAlertView alloc] init];alert.delegate = self;[alert addSubview:aView];bView.layer.cornerRadius = 10;bView.layer.masksToBounds = YES;[bView.layer setShadowOffset:CGSizeMake(2, 1)];[bView.layer setShadowRadius:5];[bView.layer setShadowOpacity:1];[alert show];[alert release]; } - (IBAction)didPressedClosed:(id)sender{[alert dismissWithClickedButtonIndex:0 animated:YES]; } - (void)willPresentAlertView:(UIAlertView *)alertView{alertView.frame = CGRectMake(0, 0, 320, 480);for (UIView* view in alertView.subviews ) {if ([view isKindOfClass:[UIImageView class]]) {UIImageView *img = (UIImageView*)view;img.backgroundColor = [UIColor clearColor];img.image = nil;}} }創(chuàng)建了一個透明圖片作為Button的背景圖片,不然點擊灰色無效(還不知道為啥,知道的請指點下)。
?
Download Code(popAlertView)
轉(zhuǎn)載于:https://www.cnblogs.com/maxfong/archive/2012/09/15/2687031.html
總結(jié)
以上是生活随笔為你收集整理的iphone开发学习,UIAlertView的简单改写,popAlertView的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: httpModule过滤无后缀名的文件夹
- 下一篇: BZOJ 1020——[SHOI2008