How to set the Cell height as dynamically in iPhone?

Posted by Pugal Devan on Stack Overflow See other posts from Stack Overflow or by Pugal Devan
Published on 2011-01-07T11:51:26Z Indexed on 2011/01/07 11:53 UTC
Read the original article Hit count: 339

Filed under:
|
|
|

Hi Friends,

In my apps, i have created table view and displayed the images and the labels in the table view. I have downloaded the image and set the image height into the another class, so i have set the image height as delegate value. In my problem is, heightForRowAtIndexPath method is call very earlier and it never calls again. So how i set the cell height depends on the image height?

     - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
     In Console:
       the height of the image is --------------------------0.000000
       the height of the image is --------------------------0.000000
       the height of the image is --------------------------0.000000
   }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

In Console:

       the height of the image is --------------------------98.567039
       the height of the image is --------------------------300.000000
       the height of the image is --------------------------232.288406
     }

Is any possible to call the heightforRowAtIndexPath method inside the cellForRowAt method. Because i have set the cell frame size and height depends on the image height. So how can i set the cell height depends on the image height?, please guide me.

Thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview