Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UILabel - how to change text position

I am trying to add subviews to my UITableView cells.

It works just perfect for me, but the text appears at the very left edge of a cell. How can I move it a little bit to the right side? I want to have a little margin from the left cell border.

Thank you in advance.

like image 407
Ilya Suzdalnitski Avatar asked Apr 07 '09 21:04

Ilya Suzdalnitski


People also ask

How do I change my UILabel text?

Changing the text of an existing UILabel can be done by accessing and modifying the text property of the UILabel . This can be done directly using String literals or indirectly using variables.

How do I align text to the left?

Align the text left or right Select the text that you want to align. On the Home tab, in the Paragraph group, click Align Left or Align Right .

How do I make my text bold on UILabel?

Double Click on Bold to select it, and then right click on it to see more options. Select font > Bold from that option. It should do the task.


1 Answers

CGRect frame = theLabel.frame;
frame.origin.x += LEFT_MARGIN;
theLabel.frame = frame;
like image 197
Daniel Dickison Avatar answered Oct 23 '22 14:10

Daniel Dickison