All I can say is in my cellForRowAtIndexPath I use the following and it works. My heightForRowAtIndexPath is nearly identical to yours double d = self tableView:table heightForRowAtIndexPath:indexPath; UILabel* label = UILabel alloc initWithFrame:CGRectMake(10, 10, 280, d-20) autorelease; label. NumberOfLines = 100; label.
LineBreakMode = UILineBreakModeWordWrap; label setFont:UIFont boldSystemFontOfSize:UIFont smallSystemFontSize; label. Text = descriptions objectAtIndex:indexPath. Section; cell.
ContentView addSubview:label.
All I can say is in my cellForRowAtIndexPath I use the following and it works. My heightForRowAtIndexPath is nearly identical to yours. Double d = self tableView:table heightForRowAtIndexPath:indexPath; UILabel* label = UILabel alloc initWithFrame:CGRectMake(10, 10, 280, d-20) autorelease; label.
NumberOfLines = 100; label. LineBreakMode = UILineBreakModeWordWrap; label setFont:UIFont boldSystemFontOfSize:UIFont smallSystemFontSize; label. Text = descriptions objectAtIndex:indexPath.
Section; cell. ContentView addSubview:label.
One possibility is you have set the CGSize width to be different in each function, for row height you have CGSizeMake(268, MAX_HEIGHT) and for setTweetText it is CGSizeMake(262, MAX_HEIGHT).
Oh sry, I set it just for trying smaller - That is not the problem. – Flocked Jan 20 '10 at 23:11 so what was the constraining size you used in both functions when you took the picture? – John Stallings Jan 20 '10 at 23:48 268 is the right size - I set it to smaller to see, if he just add space for one more line, so the cell is bigger.
But he didn´t make it right. – Flocked Jan 20 '10 at 23:58 the way you have it above though would make the textview taller than the row height you are calculating, did you get this same screenshot when you had both set at 268? – John Stallings Jan 20 '10 at 0:03.
Its not a good idea to sizeWithFont from that method, its fairly heavy and will chop up your scrolling performance. If possible calculate the heights before and store them for quick access from that method.
The code just looks how long the message (with a specified font) is and calculate the height. I set + 30, because over the message(UITextView) is a UIlabel. Now there is a problem and I don't know why: The UITextView is bigger then the cell, even if I set the size of the cell height there is a unpleasant distance between the TextView and the next cell.
Why doesn't he get the right height for some cells.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.