How to programmatically add a simple default loading(progress) bar in iphone app

前端 未结 18 2534
你的背包
你的背包 2020-12-12 17:16

I am using http communication in My iPhone app. I want to show a progress bar while it is loading data from server. How can I do it programmatically?

I just want a d

18条回答
  •  抹茶落季
    2020-12-12 17:30

    Try below code

    float progress;
    
    //components
    UIProgressView *progressBar;
    progressBar=[[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
    [progressBar setFrame:CGRectMake(30.0, 75.0, 200.0, 80.0)];
    
    int prog=progress*100;
    progressStr=[NSString stringWithFormat:@"%d%%",prog];
    [progressBar setProgress:progress];
    

提交回复
热议问题