tags:

views:

165

answers:

2

hi, UIlabel has numberOfLines property...it gives my string in 2 lines...but when i use UItextview ,i want to split no of lines based on length of text in UITextview,how can i do it?any help? UIlabel automatically splits...but UITextview did not do it?

A: 

UITextView inherently allows multiple lines of text. You just separate your lines with the "/n" character and you're done.

luvieere
hi,thanks..but i want to split no of lines based on length of UITextview,how can i do it?any help?
Mikhail Naimy
Edit the question with more detail regarding what you would like to achieve and more people would be able to help you more efficiently.
luvieere
A: 

The lines should be separated by "\r"

Here's an example:

lblNeedSubscription = [[UILabel alloc] initWithFrame:frame];
[lblNeedSubscription setNumberOfLines:0];  // allows as many lines as needed
[lblNeedSubscription setText:@"To access content\ryou need to be a paid subscriber"];
hey68you