1

i wan to display the string line by line...what changes i shd make in the below code..

i want the result to display like this

for example-

latest loan:0000
conytry:abc
amount:000

the below code is not working for new line...so what change i shd make in the below code

// code

label.text = [NSString stringWithFormat:@"Latest loan: %@ \n country:  %@ \n amount $%.2f",
                  name,country,outstandingAmount];
EmptyStack
  • 51,274
  • 23
  • 147
  • 178
Abhilash
  • 638
  • 4
  • 11
  • 28

2 Answers2

3

Don't touch that code :-@. Just set,

label.numberOfLines = 0;
EmptyStack
  • 51,274
  • 23
  • 147
  • 178
2
textLabel.lineBreakMode = UILineBreakModeWordWrap;
textLabel.numberOfLines = 0;

Check this post

Community
  • 1
  • 1
Cyprian
  • 9,423
  • 4
  • 39
  • 73