STAlertViewDemo_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > STAlertViewDemo

STAlertViewDemo

 2014/10/27 13:18:11  粉粉色  程序员俱乐部  我要评论(0)
  • 摘要:效果图:工程图:注意,此工程需要导入第三方库STAlertViewRootViewController.m//点击任何处,弹出按钮-(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event{[selfshowTextFieldUIAlertView];}#pragma-mark-functions-(void)showNormalUIAlertView
  • 标签:

效果图:

工程图:

注意,此工程需要导入第三方库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

上一篇: 小米智能摄像机售价公布 149元rmb 下一篇: 没有下一篇了!
  • 相关文章
发表评论
用户名: 匿名