2013年8月29日星期四

iOS7 TableView layout bug with UITableViewWrapperView

When working with a special problem with iOS7 Beta5, my cells in one of my tableviews is not right.
All cells' position y in screen is much higher than it should be.
Than I find that 'UITableView now initially has a subview (UITableViewWrapperView), it's allUITableViewCells' superview.'
And after tableview's initialization, I print UITableViewWrapperView
po [_messageTableView.subviews objectAtIndex:0]
<UITableViewWrapperView: 0x1814a690; frame = (0 -117; 0 117); autoresize = W+H; layer = <CALayer: 0x1814a660>>
so the following code can fix this problem
for (UIView *subview in tableView.subviews)
    {
        if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewWrapperView"])
        {
            subview.frame = CGRectMake(0, 0, tableView.bounds.size.width, tableView.bounds.size.height);
        }
    }
Done!
Have fun on the way fighting with new changes and bugs of iOS7 :).

------
My new business with my wife, wholesale meddle-to-high end men's seamless underwear in the Netherlands: https://ecosharelife.com

没有评论:

发表评论