码迷,mamicode.com
首页 > 其他好文 > 详细

STAlertViewDemo

时间:2014-10-27 12:15:46      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   ar   sp   div   on   

效果图:

bubuko.com,布布扣

工程图:

bubuko.com,布布扣

注意,此工程需要导入第三方库STAlertView

 

RootViewController.m

//点击任何处,弹出按钮
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self showTextFieldUIAlertView];
}
#pragma -mark -functions
- (void)showNormalUIAlertView
{
    stAlertView = [[STAlertView alloc] initWithTitle:@"Super alert view"
                                                  message:@"I‘m a native UIAlertView. Do you think I‘m useful?"
                                        cancelButtonTitle:@"No, ofc"
                                        otherButtonTitles:@"Yes a little bit"
                        
                                        cancelButtonBlock:^{
                                            NSLog(@"Why do you think I‘m not fancy :_( ");
                                        } otherButtonBlock:^{
                                            NSLog(@"Great! Feel free to contribute or contact me at twitter @NestorMalet!");
                                        }];
}


- (void)showTextFieldUIAlertView
{
    stAlertView = [[STAlertView alloc] initWithTitle:@"Alert view with a textfield"
                                                  message:@"I‘m a native UIAlertView with a textfiled."
                                            textFieldHint:@"What do you think about me?"
                                           textFieldValue:nil
                                        cancelButtonTitle:@"Cancel"
                                        otherButtonTitles:@"Store"
                        
                                        cancelButtonBlock:^{
                                            NSLog(@"Please, give me some feedback!");
                                        } otherButtonBlock:^(NSString * result){
                                            NSLog(@" You have said %@, but I can‘t store it :( . If you want, you can send it to me at hello@nestor.cat or via twitter @NestorMalet!", result);
                                        }];
}

 

源代码网址:http://url.cn/LSIrox

STAlertViewDemo

标签:style   blog   http   color   io   ar   sp   div   on   

原文地址:http://www.cnblogs.com/yang-guang-girl/p/4053829.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!