UIActivityIndicatorView活动指示条

活动指示条中 :

开始  startAnimating

停止  stopAnimating

aiv.hidesWhenStopped=NO;   停止时仍然可见

aiv.activityIndicatorViewStyle=UIActivityIndicatorViewStyleGray;     活动指示类型中,有灰色,白色,大白色,其中大白色和其他不同以外,不知道和直接.color=[uicolor ..]有什么不同



    self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];

    self.window.backgroundColor=[UIColor whiteColor];

    aiv = [[UIActivityIndicatorView alloc]initWithFrame:CGRectMake(50, 50, 50, 50)];

    aiv.hidesWhenStopped=NO;

//颜色和其他的不一样

    aiv.color = [ UIColor grayColor];

    UIButton * bu1 = [[UIButton alloc]initWithFrame:CGRectMake(50, 120, 80, 50)];

    bu1.backgroundColor=[UIColor blackColor];

    [bu1 setTitle:@"走一个" forState:UIControlStateNormal];

    

    UIButton * bu2 = [[UIButton alloc]initWithFrame:CGRectMake(50, 200, 80, 50)];

    bu2.backgroundColor=[UIColor blackColor];

    [bu2 setTitle:@"停一停" forState:UIControlStateNormal];


    //[aiv startAnimating];

   // aiv.activityIndicatorViewStyle=UIActivityIndicatorViewStyleGray;

    aiv.backgroundColor=[UIColor whiteColor];

    [bu1 addTarget:self action:@selector(act1:) forControlEvents:UIControlEventTouchUpInside];

    [bu2 addTarget:self action:@selector(act2:) forControlEvents:UIControlEventTouchUpInside];

    [self.window addSubview:bu1];

     [self.window addSubview:bu2];

    [self.window addSubview:aiv];

    [self.window makeKeyAndVisible];

    return YES;

}


-(void)act1:( UIButton * )sender

{

    [aiv startAnimating];

}


-(void)act2:( UIButton * )sender

{

    [aiv stopAnimating];

}




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值