UILabel - 如何更改文本位置

Ily*_*ski 7 iphone cocoa-touch

我正在尝试将子视图添加到我的UITableView单元格中.

它对我来说非常适合,但文本出现在单元格的最左边.我怎样才能将它移动到右侧?我希望左边的边框有一点边距.

先感谢您.

Dan*_*son 25

CGRect frame = theLabel.frame;
frame.origin.x += LEFT_MARGIN;
theLabel.frame = frame;
Run Code Online (Sandbox Code Playgroud)