1

Here is my storyboard: enter image description here

The method i use to get the image is:

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

     cell.mainImage.file = (PFFile *)object[@"image"];
    [cell.mainImage loadInBackground];
}

Row Height is set as:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
       return 501.0f;
}

I also would like to have the Image to be filled perfectly, much like instagram. I dont want images to have bars on the top and bottom.

farhan
  • 233
  • 1
  • 12
  • have you tried this discussion: http://stackoverflow.com/questions/18746929/using-auto-layout-in-uitableview-for-dynamic-cell-layouts-variable-row-heights?rq=1 – maddy May 27 '16 at 05:59
  • yeah ive seen that, ill give it another try. – farhan May 27 '16 at 06:08
  • my solution is here you can have look http://stackoverflow.com/questions/37235605/is-it-possible-to-have-differing-heights-in-a-uitableview-cell-when-i-use-severa/37236303#37236303 – maddy May 27 '16 at 06:13

1 Answers1

2

this was work for me

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
 return UITableViewAutomaticDimension;
}
Bhushan Vaidya
  • 702
  • 1
  • 6
  • 16