If I create a UITableViewController
, for example via File → New Project... → iOS → Master-Detail Application in Xcode, a UITableView
is created with a prototype cell.
The generated view hierarchy is:
A left "margin" is automagically created between the Cell's Content UIView
left edge and the "Title" text's UILabel
element as shown below in orange.
This results in a corresponding margin between the device's screen edge and the UILabel
text at runtime:
So, where is the width of this gap set, and how can it be adjusted?
The controls in the Size Inspector for the UILabel are greyed out:
My preferred option would to be able to set the width of this gap from within Interface Builder, but I would also like to understand where this gap is being set, and how to alter it programmatically.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…