How to rotate UITableViewCellAccessoryDisclosureIndicator?

后端 未结 1 1135
失恋的感觉
失恋的感觉 2020-12-17 03:11

I\'m making a UITableView with expandable/collapsable cells for ios app. I put a UITableViewCellAccessoryDisclosureIndicator on these cells but I\'

相关标签:
1条回答
  • 2020-12-17 03:31

    This is not exactly what you want, but this the first thing I thought of. First, instantiate a button of type UIButtonTypeDetailDisclosure:

    UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    

    Next, rotate the button 90 degrees:

    CGAffineTransform rotationTransform = CGAffineTransformIdentity;
    rotationTransform = CGAffineTransformRotate(rotationTransform, DegreesToRadians(90));
    button.transform = rotationTransform;
    

    Finally, use the button as the accessoryView:

    cell.accessoryView = button;
    

    Hope that helps.

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