Abhilash
Abhilash

Reputation: 668

how to display text in new line

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];

Upvotes: 1

Views: 1838

Answers (2)

EmptyStack
EmptyStack

Reputation: 51374

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

label.numberOfLines = 0;

Upvotes: 3

Cyprian
Cyprian

Reputation: 9453

textLabel.lineBreakMode = UILineBreakModeWordWrap;
textLabel.numberOfLines = 0;

Check this post

Upvotes: 2

Related Questions