Access iOS 7 hidden UITableViewCellScrollView?

后端 未结 2 740
庸人自扰
庸人自扰 2021-02-06 13:40

Apple change the UITableViewCell hierarchy in iOS 7

Using iOS 6.1 SDK


   | 
   |           


        
相关标签:
2条回答
  • 2021-02-06 14:33

    Objective-C:

    UIView *cellScrollView = [[cell contentView] superview];
    [cellScrollView setClipsToBounds:NO];
    

    Swift:

    let cellScrollView = cell.contentView.superview
    cellScrollView?.clipsToBounds = false
    
    0 讨论(0)
  • 2021-02-06 14:35

    The only way to access the new CellScrollView is by accessing the cell superview after it was created.

    I added the following cellForRowAtIndexPath:

    cell = [[UICustomTableViewCell alloc] init];
    UIView *cellScrollView = cell.myLabel.superview;
    [cellScrollView.layer setMasksToBounds: NO];
    

    I think Apple should give us a way to access this new ScrollView without hacking.

    0 讨论(0)
提交回复
热议问题