1

I would like to shift the text in the label slightly. I have already placed the text on the right by aligning in the attributes inspector. But I would like to move it slightly to the left. Not sure what button to press. I have looked through all the features in attributes inspector, but still not able to find it.

Here is how it looks like now: enter image description here

Like to move the zero slightly to the left somemore. How do i do it?

lakshmen
  • 28,346
  • 66
  • 178
  • 276

1 Answers1

1

If you want to move the text within the label, you will have to subclass UILabel and override drawTextInRect: like this:

@implementation RDLabel

- (void)drawTextInRect:(CGRect)rect {
    CGRect newRect = CGRectMake(0, 0, rect.size.width - 10, rect.size.height);
    [super drawTextInRect:newRect];
}
@end

This will move the text 10 points to the left if you have the text right justified.

rdelmar
  • 103,982
  • 12
  • 207
  • 218