Martino Bonfiglioli
Martino Bonfiglioli

Reputation: 1577

iOS 13 UITableViewCell custom accessoryView goes out of bounds

Working with the latest iOS 13 beta

I really don't understand if it's beta issues or my issue, but I don't have this problem with iOS 12

code

 let button = UIButton(type: .custom)
 button.setTitle("connect", for: .normal)
 button.backgroundColor = UIColor(rgb: 0xFF0E83)
 button.sizeToFit()
 cell.accessoryView = button
 cell.textLabel?.text = "Title"
 cell.detailTextLabel?.text = "Subtitle"

with result

enter image description here

Did someone had the same issue and found a solution? Thanks

Upvotes: 3

Views: 2389

Answers (3)

nemo
nemo

Reputation: 11

I am using UILabel instead of UIButton, and same issue occurred with iOS13.1. @Amerino's workaround does well.

Upvotes: 1

 Amerino
Amerino

Reputation: 389

If you put the uibutton in a uiview it will work on iOS 13.0.

Upvotes: 3

Martino Bonfiglioli
Martino Bonfiglioli

Reputation: 1577

This problem is solved in the latest beta of iOS 13.1 (beta 2)

enter image description here

Upvotes: 0

Related Questions