资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

UIAlertView提示控件-创新互联

服从UIAlertViewDelegate 协议

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:域名注册网站空间、营销软件、网站建设、康保网站维护、网站推广。

     Title : 标题
      message : 提示消息
     delegate : 代理
     cancelButtonTitle : 取消显示
     otherButtonTitles : 其他按钮显示文字,只给出按钮显示的文字即可,可多个

UIAlertView * alertView = [[UIAlertView alloc]initWithTitle:@"警告"
                                                            message:@"手机号码输入错误"
                                                           delegate:self
                                                  cancelButtonTitle:@"取消"
                                                  otherButtonTitles:@"确定",@"sure", nil];

UIAlertViewStyleDefault = 0,           默认

UIAlertViewStyleSecureTextInput,        密码

UIAlertViewStylePlainTextInput,         输入框

UIAlertViewStyleLoginAndPasswordInput      登录,密码

       alertView.alertViewStyle = UIAlertViewStyleSecureTextInput;

       [alertView show];        让alertView 弹出

       [alertView release];

    当点击 alertView 上 button时 触发的方法.
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
   取消按钮的buttonindex 为 0
   其他的按钮从左往右依次 + 1 ;

 通过switch..case 匹配是哪一个按钮按下
   switch (buttonIndex) {
       case 0:
           NSLog(@"取消");
           break;
       case 1:
           NSLog(@"确定");
           break;
       case 2:
           NSLog(@"sure");
           break;
       default:
           break;
   }
}

当我们取消一个视图(如。用户单击按钮)。这不是用户单击取消按钮时调用。

如果没有定义的委托,我们模拟点击取消按钮

- (void)alertViewCancel:(UIAlertView *)alertView;

- (void)willPresentAlertView:(UIAlertView *)alertView;

动画和之前显示视图

- (void)didPresentAlertView:(UIAlertView *)alertView;

动画后

- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex;

之前动画和隐藏视图

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;

动画后

- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView;

编辑的任何违约后称为字段添加的风格

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章题目:UIAlertView提示控件-创新互联
文章分享:http://cdkjz.cn/article/ddgdhj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220