【发布时间】:2009-07-21 15:45:39
【问题描述】:
您好!
我添加了一个 UIActivityIndicatorView 作为 UITableView 的子视图。目的是在使用新数据刷新基础表后淡出此视图。
问题是表格视图中的sections(如A、B、C等)好像是在Activity Indicator出现后才添加的,暂时部分阻塞了Activity Indicator .
当涉及到带有部分的表视图上的活动指示器时,是否有“更好的方法”(或更合适的方法)来做这种事情?现在我这样做是为了淡出loading 活动指示器视图:
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:1.0];
[loading setAlpha:0.0f];
[UIView commitAnimations];
FWIW,调用 [myTableView bringSubviewToFront:myActivityIndicatorView] 的等价物似乎也无济于事。
除此之外,还有从超级视图中删除loading 的问题。我想我需要使用setAnimationDidStopSelector: 并将加载视图作为上下文传递(也许我真的不需要那个 CGContextRef 行)。
【问题讨论】:
标签: iphone uitableview core-animation fade