UITableViewRowAnimation with visible imperfections

I have created a UITableView programmatically with 3 cells in the section at index 0. Now when I flip the UISwitch in the cell at index 0 in that section it animates the insertion of a third cell.

Unfortunately I get those weird lines at the end of a UITableViewRowAnimation as you can see in the picture below. The same happens when the deletion of the cell is animated.

http://cl.ly/0l120K091b3s0h3J1l3m

Can someone tell me how to fix this? It looks really ugly. Here the code that gets executed when the UISwitch is on:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

NSArray *rowAtIndex2inSectionAtIndex0 =
        [NSArray arrayWithObject:
        [NSIndexPath indexPathForRow:2 inSection:0]];

if ([defaults boolForKey:@"one"] == 1 &&
    [defaults boolForKey:@"two"] == 1 &&
    numberOfRowsInSection0 == 2)
{
    numberOfRowsInSection0++;

    [self.tableView
    insertRowsAtIndexPaths:rowAtIndex2inSectionAtIndex0
    withRowAnimation:UITableViewRowAnimationTop];
}
Hello, buddy!责编内容来自:Hello, buddy! (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 移动开发 » UITableViewRowAnimation with visible imperfections

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录