早上好,
我这个问题已经有整整一周了,而且很奇怪。
我有一个用VM填满的表,我可以打开/关闭/重新启动等等。每一行都有一个UITableViewCellAccessoryDetailDisclosureButton当我向虚拟机发送一个操作时,我每隔3秒检查一次该操作是否已成功完成等待UITableViewCellAccessoryDetailDisclosureButton被一个活动indicator.When替换一个操作完成了虚拟机所在的行应该刷新,这很好用。但问题是有时..实际上,有时当VM完成并且没有accessoryType时,UITableViewCellAccessoryDetailDisclosureButton不会返回,因为row.This只是在我向其发送操作的随机行中...假设我有5行。
X*    
X*
X*
X*
X*(row= row,* = UITableViewCellAccessoryDetailDisclosureButton),然后我将它们全部打开,然后就会发生这种情况
X 
X
X*
X*
X然后在随机的地方,消失了,直到我重新打开整个UIView,它才会回来。
为什么会这样呢?下面是一些代码。
[activityView stopAnimating];
[timer invalidate];
NSArray *indexPathArray = [NSArray arrayWithObject:TheindexPath(This is the indexpath of the row where an action should be done.)];
[TheTableWithMachines reloadRowsAtIndexPaths:indexPathArray withRowAnimation:UITableViewRowAnimationFade];
[activityView release];在
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath我甚至检查单元格是否有按钮,如果没有..添加它
if(cell.accessoryType != UITableViewCellAccessoryDetailDisclosureButton)
        {
            cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
        }我看了很久终于把它修好了!
活动指示符是一个AccesoryView,而是我在代码末尾设置此单元格所需的单元格的AccesoryType
但是我仍然不知道为什么有时会消失。
不管怎样,它现在是有效的。
发布于 2011-06-01 00:33:06
看一看UIActivityIndicatorView的hidesWhenStopped属性
https://stackoverflow.com/questions/6184168
复制相似问题