我已经制作了一个自定义的
这是我的代码:
在iOS 5.0中,这个功能是可以用的。从iOS 5.1开始,它再次停止显示闹钟开关。以下是一些截图。
1) 编辑模式
2) 编辑后 (iOS 5.0)
3) 编辑后 (iOS 5.1及以上)
如果我向上滚动,然后再向下滚动(以重新绘制单元格),开关将再次出现。有人知道为什么会发生这种情况吗?奇怪的是,在iOS 5.0中它运作得很好,但现在却不行了。
tableviewcell
,并覆盖了方法 -(void) setEditing:(BOOL)editing animated:(BOOL)animated
,以便在编辑模式下隐藏 UISwitch
。这是我的代码:
-(void) setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing:editing animated:animated];
if (animated==YES) {
// With animation
if (editing == NO) {
// Editing stopped
[UIView animateWithDuration:0.3
animations:^{
[self.alarmSwitch setAlpha:1.0];
}];
[self.alarmSwitch setEnabled:YES];
} else {
// Editing started
[UIView animateWithDuration:0.3
animations:^{
[self.alarmSwitch setAlpha:0.0];
}];
[self.alarmSwitch setEnabled:NO];
}
} else {
// Without animation
// .................
}
}
在iOS 5.0中,这个功能是可以用的。从iOS 5.1开始,它再次停止显示闹钟开关。以下是一些截图。
1) 编辑模式
2) 编辑后 (iOS 5.0)
3) 编辑后 (iOS 5.1及以上)
如果我向上滚动,然后再向下滚动(以重新绘制单元格),开关将再次出现。有人知道为什么会发生这种情况吗?奇怪的是,在iOS 5.0中它运作得很好,但现在却不行了。