Sam*_*007 0 iphone objective-c uiactivityindicatorview
我想在我的应用中使用活动指示器.
我在我的应用程序中使用JSON解析.首先,当我显示数据下载活动指示器时单击同步按钮,下载完成时停止.
同样isuue在这里,当应用程序启动数据下载时,我也在应用程序中放置活动指示器.
我正在使用以下方法进行连接...
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
}
Run Code Online (Sandbox Code Playgroud)
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[indicator setCenter:CGPointMake(YourXPoint, YourYPoint)];
[self.view addSubview:indicator];
[indicator startAnimating];
Run Code Online (Sandbox Code Playgroud)
当你想要停止指标使用这个
[indicator stopAnimating];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
927 次 |
| 最近记录: |