Robbie Mills Robbie Mills - 3 years ago 218
Swift Question

How to modify label in UITableView

I have a UITableView with static cells. How can I modify the label that is added in the cell to give it an offset of 50 points from the edge so that the icon appears next to it?

enter image description here

All the usual constraint options are greyed out, as are the Frame Rectangle items in the View section (ie, the x and y coordinates)

Answer Source

Set the cell type to custom and add your own subviews. You can't modify the layout of the default views (the label, detail label, and image view) in a table view cell.

Having said that, if you use the official image view of the cell, it should just work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download