Anyone else notice that iOS 7 lays out custom accessoryViews differently than built-in accessoryTypes?
Like this:
The top one is done using:
cell.accessoryView = cell.accessoryButton;
(where accessoryButton is a customized UIButton) while the second one is done using:
cell.accessoryView = nil;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
Same code, same app, same Xcode, but running on iOS 6 instead:
Is this a bug in the SDK? Or something I can control via code?
If you are sub-classing the UITableViewCell
you can adjust it in layoutSubviews
- (void)layoutSubviews {
[super layoutSubviews];
CGRect accessoryViewFrame = self.accessoryView.frame;
accessoryViewFrame.origin.x = CGRectGetWidth(self.bounds) - CGRectGetWidth(accessoryViewFrame);
self.accessoryView.frame = accessoryViewFrame;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With