0

I am very new to iPhone Development. I am fetching data from the table and putting it onto the UITableViewCell. But sometimes this data is very small and sometimes may be large. According to the data size I need to manage the height of cell and data is displayed properly in a cell with multiline if it doesn't fit to single line. Is there any other option for me instead of UITableView or I am in Right way. If yes then how should I proceed?

Ravi Nalawade
  • 37
  • 2
  • 7
  • possible duplicate of [Different height for alternative cell in UITableView](http://stackoverflow.com/q/3529246/) – outis Jul 14 '12 at 20:22

2 Answers2

3

use this delegate it will increase the row size

-(CGFloat)tableView :(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

 {
    return 80;   //value can be changed depending, how much height you need.
 }
Ajeet Pratap Maurya
  • 4,244
  • 3
  • 28
  • 46
0

A UITableView is ok for you. In your UITableViewDelegate, you can use

– tableView:heightForRowAtIndexPath:

to set the row height. Now, if your data is displayed correctly or not, it depends on the content you are managing in the table view cell. UITextField is intrinsically one-line; but you could try with UITextView.

Otherwise, if you are looking for more advanced possibilities, have a look at this tutorial about customizing cell view content.

Have a look at this S.O. topicenter link description here for a snippet of code about calculating the size of string.

Community
  • 1
  • 1
sergio
  • 68,819
  • 11
  • 102
  • 123