当前位置:编程学习 > wap >>

iPhone开发 UIProgressView与计时器一起使用

-(IBAction)btnStartClick

{

    proValue=0;

    timer = [NSTimerscheduledTimerWithTimeInterval:0.001target:selfselector:@selector(changeProgress) userInfo:nilrepeats:YES];

}

-(void)changeProgress

{

    proValue +=1.0;

    if(proValue > 1500)

    {

        //停用计时器

        [timer invalidate];       

    }

    else

    {

        [proView setProgress:(proValue/1500)];

    }

}

 

摘自 凡娃软件
补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,