2

im passing huge data to a label of a cell.So i need to wrap the line.I tried the below methods ------- cell.textlabel.lineBreakMode = UILineBreakModeWordWrap; cell.textlabel.lineBreakMode =UILineBreakModeTailTruncation;By truncating the label also no use.In this way my problem didnt get solved.I want all the data to be displayed in the same font size also.If the label of a cell containg less data,the font size is different and if the label of a cell containing more data,the font size is small.Please help me out.....thanks in advance

Alekhya
  • 69
  • 2
  • 9

2 Answers2

1

there are two things you need to know when wrapping text to label. 1. numberOfLine on which you want to display the text 2. lineBreakMode.

most of the time we set numberOfLine = 0 when we need to wrap the text, but keep in mind that 0 indicate , uses as many line as needed to display the text. This will cause to push the label view beyond it's container view. So make sure you have used

 cell.textLabel.numberOfLines=1; 
 cell.textLabel.lineBreakMode = UILineBreakModeTailTruncation;
Black Tiger
  • 1,201
  • 11
  • 12
1

you can find the uilabels expected size programetically and also appply the word wrap..please refer this.UILabel size according to text

Community
  • 1
  • 1
Sat
  • 1,616
  • 3
  • 22
  • 40
  • Thank u for ur suggestions,i got the solution.We should fix the numberoflines of a cell to zero and then wrap the data – Alekhya Feb 08 '11 at 06:21