zoukankan      html  css  js  c++  java
  • 警告框(AlertView)与进度轮结合使用

      在程序中,当提交数据或者等待某一个进程时,需要给用户一个看得见的反馈,以表明设备正在进行某项活动或者处理,无法进行用户交互。而在iphone开发 中,解决这个问题的简洁办法就是创建一个不带按钮的对话框,然后在该对话框的底部创建一个进度轮,最后调整警告框的布局结构,并手动关闭警告框。具体实现 代码如下:
    -(IBAction)DoneEdting:(id)sender
    {

    //创建并显示无按钮警告框

    baseAlert=[[[UIAlertView alloc]initWithTitle:@"数据上传中,请稍候"

    message:nil

    delegate:self

    cancelButtonTitle:nil

    otherButtonTitles:nil] autorelease];

    [baseAlert show];



    //创建活动进度轮,并添加到无按钮警告框

    UIActivityIndicatorView *aiv=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

    aiv.center=CGPointMake(baseAlert.bounds.size.width/2.0f, baseAlert.bounds.size.height-40.0f);

    [aiv startAnimating];

    [baseAlert addSubview:aiv];

    [aiv release];

    //延迟3秒后关闭对话框,这里可根据应用程序合理设置

    [self performSelector:@selector(performSelector:) withObject:nil
    afterDelay:3.0f];
    }
    //关闭警告框

    -(void)performDismiss
    {
    [baseAlert dismissWithClickedButtonIndex:0 animated:NO];
    }


  • 相关阅读:
    Nginx +keepalived
    iptables
    编译安装HTTPD 2.4.9版本
    Apache+lvs高可用+keepalive(主从+双主模型)
    LVS-HA
    corosync+pacemaker实现高可用(HA)集群
    NTP
    私人定制自己的linux小系统
    大数据处理-bitmap是个神马东西
    CSS3制作苹果风格键盘
  • 原文地址:https://www.cnblogs.com/wengzilin/p/2392316.html
Copyright © 2011-2022 走看看