If this is only one aligned text, as in your example, you can use various workarounds. I personally created a subclass of UILabel as follows:
@implementation VerticalLabel - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { self.numberOfLines = 0; } return self; } - (void)setText:(NSString *)text { NSMutableString *newString = [NSMutableString string]; for (int i = text.length-1; i >= 0; i--) { [newString appendFormat:@"%c\n", [text characterAtIndex:i]]; } super.text = newString; } @end
Now you just need to replace:
UILabel *lbl = [[UILabel alloc] init];
with:
UILabel *lbl = [[VerticalLabel alloc] init];
to get vertical text.
Fazil source share