views:

162

answers:

2

I create a label in my iPhone application as:

UILabel * lab=[[UILabel alloc]initWithFrame:CGRactMake(100.0,100.0,100.0,10.0)];
lab.text=@"1 2 3 4 5 6 7 8 9 0";

And also added window as subview.

Now this label appearing in my view as: 1 2 3 4 5 6 7 8 9 0

I want it as:

1
2
3
4
5
6
7
8
9
0

I mean it will appear as portrait mode. Is it possible or not?

Or can we draw a char then rotate?

+1  A: 
UILabel * lab=[[UILabel alloc]initWithFrame:CGRectMake(100.0,100.0,100.0,10.0)];
lab.numberOfLines = 0;
lab.text=@"1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n 0";
oxigen
A: 

Either add newlines (as oxigen mentioned), or set it's with to very small and set the numberOfLines property to 0 and lineBreakMode to UILineBreakModeWordWrap

drvdijk