2

I have a tableview with setting:

self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 50;

It's work fine in 5/5s, 6/6s, 7 but its not working in 6s+/7+, images is stretch.

5/5s 6/6s, 7 devices 6s+/7+ devices

ZNApps
  • 55
  • 2
  • 8

1 Answers1

6

Make content mode of Uiimageview to Aspect fill .It will solve your issue

Raman Srivastava
  • 396
  • 1
  • 14
  • Cell height in plus devices is small than normal devices :( so, cell is stretch – ZNApps Jun 28 '17 at 07:29
  • have you used aspect ratio? if not then please use it in your contraints. – Raman Srivastava Jun 28 '17 at 07:31
  • No, my cell with single image constraint 4 edges, no more. Setup table with estimatedRowHeight + rowHeight. My 6s work fine :( 6s+ is fail – ZNApps Jun 28 '17 at 07:35
  • add aspect ration as well. It will solve you issue as aspect ratio is used for the image to look proper in all screen size. – Raman Srivastava Jun 28 '17 at 07:40
  • Aspect ratio is good with fix size image. So, I want appear any images with any size ? Any suggest ? Thank @Raman – ZNApps Jun 28 '17 at 08:37
  • Aspect ratio is even good with dynamic size images as well. When you will use autolayout for your image don't add contraints for height and width just use aspect ratio. It will work fine – Raman Srivastava Jun 28 '17 at 08:56
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/147836/discussion-between-znapps-and-raman-srivastava). – ZNApps Jun 28 '17 at 14:20