我正在使用此代码显示活动指示器:
UIActivityIndicatorView *av = [[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
av.frame=CGRectMake(0.5*winSize.width-winSize.width/4, 0.80*winSize.height , winSize.width/2, winSize.width/8);
[av setBackgroundColor:[UIColor colorWithRed:0.23 green:0.23 blue:0.23 alpha:0.75]];
av.layer.cornerRadius=4;
av.tag = 31000;
[[[CCDirector sharedDirector]view]addSubview:av];
[av startAnimating];
并删除它:
UIActivityIndicatorView *tmpimg = (UIActivityIndicatorView *)[[[CCDirector sharedDirector]view] viewWithTag:31000];
if(tmpimg)
[((UIView *)tmpimg) removeFromSuperview];
我需要的是仅删除指示器本身(滚动的圆圈)并留下我刚刚绘制的他的视图的矩形(av.frame
)。
我该怎么做?非常感谢 。