Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Indirect Approach :</strong> </p> <p>Set your custom height for your UITableViewCell using </p> <pre><code>- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return [indexPath row] * 40; } </code></pre> <p>Find the total number of rows at a point of your program ... Using the numberOfRowsInSection, get the number of rows. </p> <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.yourArray count]; //yourArray is the array with which you are populating the tableView } </code></pre> <p>If you have more than one section, multiple it with the result for the number of rows for the effective number of rows.</p> <p>Now </p> <pre><code>UITableView Actual Height = Height of UITableViewCell * Total number of rows. </code></pre> <p><strong>Updated Answer:</strong></p> <p>If the cell sizes vary, you might have to do do one of these: </p> <ol> <li><p>Force the text to a smaller size so that all cells have equal height... This can be done using </p> <p>'sizeToFit'</p></li> <li><p>You will have to find the height of the text using another function. Something like...</p> <ul> <li>(float)calculatedHeight { return textLabel.frame.origin.ytextLabel.frame.size.height5; }</li> </ul></li> <li><p>You can look at <a href="http://www.raddonline.com/blogs/geek-journal/iphone-sdk-resizing-a-uitableviewcell-to-hold-variable-amounts-of-text/" rel="nofollow">THIS </a> tutorial for resizing UITableViewCell for variable text.</p></li> <li><p><a href="https://discussions.apple.com/thread/1525150?start=0&amp;tstart=0" rel="nofollow">https://discussions.apple.com/thread/1525150?start=0&amp;tstart=0</a></p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload