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

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

DXAlertViewDemo

 2014/10/27 13:22:43  粉粉色  程序员俱乐部  我要评论(0)
  • 摘要:效果图:工程图:此工程要引入第三方库DXAlertViewRootViewController.m//点击任何处,出现提示框-(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event{[selftwoBtnClicked];}-(void)twoBtnClicked{DXAlertView*alert=[[DXAlertViewalloc]initWithTitle:@"Congratulations"contentText
  • 标签:view

效果图:

工程图:

此工程要引入第三方库DXAlertView

 

RootViewController.m

//点击任何处,出现提示框
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self twoBtnClicked];
}

- (void)twoBtnClicked
{
    DXAlertView *alert = [[DXAlertView alloc] initWithTitle:@"Congratulations" contentText:@"You have bought something" leftButtonTitle:@"Ok" rightButtonTitle:@"Fine"];
    [alert show];
    alert.leftBlock = ^() {
        NSLog(@"left button clicked");
    };
    alert.rightBlock = ^() {
        NSLog(@"right button clicked");
    };
    alert.dismissBlock = ^() {
        NSLog(@"Do something interesting after dismiss block");
    };
}

- (void)OneBtnClicked
{
    DXAlertView *alert = [[DXAlertView alloc] initWithTitle:@"Congratulations" contentText:@"You have bought something" leftButtonTitle:nil rightButtonTitle:@"Fine"];
    [alert show];
    alert.rightBlock = ^() {
        NSLog(@"right button clicked");
    };
    alert.dismissBlock = ^() {
        NSLog(@"Do something interesting after dismiss block");
    };
}

 

源代码地址:http://url.cn/OlsJ8E

上一篇: 90后社交网络行为报告:不拒陌生人,TFBOYS成最爱 下一篇: 没有下一篇了!
发表评论
用户名: 匿名