2011-01-29 27 views
0

以下代码用于显示下载进度。操作单显示,执行下载的代码在不同的线程上运行,并随着进程更新进度。我已经使用调试器确认了这一点。问题是实际的进度条从不显示在动作表上。每次更新后我都会延迟1秒,以确保我不会错过它。有没有什么我失踪至于设置酒吧?进度条不显示在操作单上

self.pActionSheet=[[[UIActionSheet alloc] initWithTitle:@"Downloading Alerts. Please Wait.\n\n\n" delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil] autorelease]; 
pBarView=[[UIProgressView alloc] initWithFrame:CGRectMake(0.0f,40.0f, 220.0f, 90.0f)]; 
[pBarView setProgressViewStyle:UIProgressViewStyleDefault]; 
[pActionSheet addSubview:pBarView]; 
[pBarView release]; 
[pBarView setProgress:0.0f]; 
[pActionSheet showInView:self.view]; 
pBarView.center=CGPointMake(pActionSheet.center.x,pActionSheet.center.y); 

回答

0

事实证明,这是问题:

pBarView.center=CGPointMake(pActionSheet.center.x,pActionSheet.center.y); 

必须已经把它的视图。当我手动指定一些坐标时,它显示正常。