Multi-line UITableViewCell using UITableViewCellStyleValue2 style?

Another round of searching found this: the-lost-beauty.blogspot.com/2009/11/mul... Quickly tried it, and it works - just need to set the font size down a bit.

It sounds to me like you'll have to create a custom UITableCell. The only way to ensure the text lines up is to get the margin/text width values correct, which can be done via trial and error, or using a measuring tool such as xScope.

I also had the problem that the textLabel and the detailTextLabel had a different position. Solution: For the detailTextLabel use the same height like the textLabel (e.g. 13).

Create a custom cell for you table and place a UILabel and a UITextView inside it. Position the label & text view to match their x,y positions to the other cells you are using in that table. You insert "\n" in the textview's text wherever you want line breaks to occur.

You resize the textview height depending on the number of lines in the textview using something like: CGRect frame = yourTextView. Frame; frame.size. Height = yourTextView.contentSize.

Height; yourTextView. Frame = frame; return frame.size. Height + 20.0; // Pad the cell's height as necessary for your applicaion.

Normally, it is hard to define where should put a line break. – Shivan Raptor Oct 4 at 10:34.

I'm trying to figure out how to replicate the UITableViewCellStyleValue2 style so that the detail text can be multiple lines - as seen in the 'address' cells in the Contacts app. Like the Contacts app, some of the fields (like street name) are optional; so it would show say 3 lines instead of 4, if the street was not nil. I'm I missing a trick, or do I have to create a custom cell in IB?

How to ensure the text and detail text labels line-up with other UITableViewCellStyleValue2 cells? Thanks for any tips.

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.

Related Questions