Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line break in UILabel?

I have this code:

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(25, 25, 275, 40)];
label.text = @"I am learning Objective-C for the\n very first time!";
[self.view addSubview:label];

But for some reason it doesn't insert a new line... how do I put a line break in an UILabel?

like image 526
user115422 Avatar asked Dec 04 '22 01:12

user115422


1 Answers

Please check that

   UILabel *yourLabel;
   yourLabel.numberoflines = 0

or not..

if it is not like this please set it to zero

like image 189
Murali Avatar answered Jan 08 '23 06:01

Murali