display a long string in a table row
i have a tableview which displays the result from the web service the result fron the web sevice is in form of string array, where each string in the array is pretty long. It is like "1|123|JP Morgan|111|2000.0|Pending", similarly there are strings which i diplay in each row of the table. but as you can see the string is very long, to display it in a single table row. 开发者_JS百科in the table view, i can just view first 3 ie "1|123|JP Morgan" the it shows.....
how can i display the entire string in the table
Your options are to make it smaller or make a custom table cell. To change the size, set the property cell.textLabel.font
to a font of a smaller size (e.g. using [UIFont systemFontOfSize:10]
. You may also want to change cell.textLabel.numberOfLines
to something greater than 1.
To see more about making custom cells, read the Table View Programming Guide.
You can add a UILabel
to your cell's contentView
. If you do this, you can set the UILabel.numberOfLines
to a number greater than 1. If you set it to 0, it will use as many lines as needed.
精彩评论