Frage

I have faced issue in ios 7 while in ios 6 it is working fine. The problem is I'm unable to get my custom cell in sub views of the table view in ios 7 while I got my custom cell in sub views of the table view in ios 6. I have printed logs of sub views of table view for ios 7 and ios 6 given below.

Log for iOS 7

<__NSArrayM 0x15e83460>(
<UITableViewWrapperView: 0x15dd4210; frame = (0 0; 675 621); autoresize = W+H; layer = <CALayer: 0x15dd4280>>,
<UIImageView: 0x15dd3bd0; frame = (0 616; 675 5); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x15dd1fe0>>,
<_UITableViewCellSeparatorView: 0x15ec3550; frame = (15 483; 660 1); autoresize = W; layer = <CALayer: 0x15ed3fd0>>,
<_UITableViewCellSeparatorView: 0x15ed8b40; frame = (15 527; 660 1); autoresize = W; layer = <CALayer: 0x15ed84a0>>,
<_UITableViewCellSeparatorView: 0x15ecbc80; frame = (15 571; 660 1); autoresize = W; layer = <CALayer: 0x15ed8450>>,
<_UITableViewCellSeparatorView: 0x15ed74d0; frame = (15 615; 660 1); autoresize = W; layer = <CALayer: 0x15ea6f80>>,
<_UITableViewCellSeparatorView: 0x15ed7450; frame = (15 659; 660 1); autoresize = W; layer = <CALayer: 0x15ea6c90>>,
<_UITableViewCellSeparatorView: 0x15eb0e20; frame = (15 703; 660 1); autoresize = W; layer = <CALayer: 0x15eb5c70>>,
<_UITableViewCellSeparatorView: 0x15eb36e0; frame = (15 747; 660 1); autoresize = W; layer = <CALayer: 0x15eb56d0>>,
<_UITableViewCellSeparatorView: 0x15eb7400; frame = (15 791; 660 1); autoresize = W; layer = <CALayer: 0x15ed3f10>>,
<_UITableViewCellSeparatorView: 0x15ea2e00; frame = (15 835; 660 1); autoresize = W; layer = <CALayer: 0x15eb12e0>>,
<_UITableViewCellSeparatorView: 0x15eb6d50; frame = (15 879; 660 1); autoresize = W; layer = <CALayer: 0x15ec5230>>,
<_UITableViewCellSeparatorView: 0x15ec9db0; frame = (15 923; 660 1); autoresize = W; layer = <CALayer: 0x15ec9e20>>,
<_UITableViewCellSeparatorView: 0x15eb4ac0; frame = (15 967; 660 1); autoresize = W; layer = <CALayer: 0x15eb4b30>>,
<UIImageView: 0x15dd3d10; frame = (670 614; 5 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x15dd3df0>>
)

Log for iOS6

<__NSArrayM 0x9b6a490>(
<MyCustomCell: 0x9b272a0; baseClass = UITableViewCell; frame = (0 396; 675 44); autoresize = W; layer = <CALayer: 0x9b2c940>>,
<MyCustomCell: 0x9b2a940; baseClass = UITableViewCell; frame = (0 352; 675 44); autoresize = W; layer = <CALayer: 0x9b2ffc0>>,
<MyCustomCell: 0x9b2dfe0; baseClass = UITableViewCell; frame = (0 308; 675 44); autoresize = W; layer = <CALayer: 0x9b33660>>,
<MyCustomCell: 0x9b31680; baseClass = UITableViewCell; frame = (0 264; 675 44); autoresize = W; layer = <CALayer: 0x9b34f10>>,
<MyCustomCell: 0x9b6ea90; baseClass = UITableViewCell; frame = (0 220; 675 44); autoresize = W; layer = <CALayer: 0x9b6cd20>>,
<MyCustomCell: 0x9b70140; baseClass = UITableViewCell; frame = (0 176; 675 44); autoresize = W; layer = <CALayer: 0x9b73fd0>>,
<MyCustomCell: 0x9b75bc0; baseClass = UITableViewCell; frame = (0 132; 675 44); autoresize = W; layer = <CALayer: 0x9b70d70>>,
<MyCustomCell: 0x9b797c0; baseClass = UITableViewCell; frame = (0 88; 675 44); autoresize = W; layer = <CALayer: 0x9bee0d0>>,
<MyCustomCell: 0x9b7c000; baseClass = UITableViewCell; frame = (0 44; 675 44); autoresize = W; layer = <CALayer: 0x9bf4880>>,
<MyCustomCell: 0x9beef40; baseClass = UITableViewCell; frame = (0 0; 675 44); autoresize = W; layer = <CALayer: 0x9beeea0>>,
<UIImageView: 0x9bf7070; frame = (0 614; 675 7); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x9bf7110>>,
<_UITableViewSeparatorView: 0x9bf65a0; frame = (0 483; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6600>>,
<_UITableViewSeparatorView: 0x9bf6650; frame = (0 527; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf66b0>>,
<_UITableViewSeparatorView: 0x9bf66e0; frame = (0 571; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6740>>,
<_UITableViewSeparatorView: 0x9bf6770; frame = (0 615; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf67d0>>,
<_UITableViewSeparatorView: 0x9bf6800; frame = (0 659; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6860>>,
<_UITableViewSeparatorView: 0x9bf68b0; frame = (0 703; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6910>>,
<_UITableViewSeparatorView: 0x9bf6940; frame = (0 747; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf69a0>>,
<_UITableViewSeparatorView: 0x9bf69d0; frame = (0 791; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6a30>>,
<_UITableViewSeparatorView: 0x9bf6a60; frame = (0 835; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6ac0>>,
<_UITableViewSeparatorView: 0x9bf6b30; frame = (0 879; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6b90>>,
<_UITableViewSeparatorView: 0x9bf6bc0; frame = (0 923; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6c20>>,
<_UITableViewSeparatorView: 0x9bf6c50; frame = (0 967; 675 1); opaque = NO; autoresize = W; layer = <CALayer: 0x9bf6cb0>>,
<UIImageView: 0x9bf71c0; frame = (668 614; 7 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x9bf7260>>
)

I have also faced issue in separator line also in ios 7. Separator line is bit shifted in screen while in ios 6 separator line is showing perfectly. any suggestions would be appreciate.

War es hilfreich?

Lösung

You custom cells are now subviews of UITableViewWrapperView.

You can access the cells like this:

id tableViewWrapperView = [[tableView subviews] objectAtIndex:0];
if ([tableViewWrapperView isKindOfClass:NSClassFromString(@"UITableViewWrapperView")])
{
    NSArray *myCells = [tableViewWrapperView subviews];
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top