0

I am trying to change frame sizes of an imageView. textLabel and detailTextLabel of UITableViewCell property on inside the UITableView. I tried with change the frame size, resizing mask, resizing subviews and so on, but there is no use. Is there any way to change default frame size? and I am using UITableViewCellStyleSubtitle.

Note: My images took their own image size.

Sivanathan
  • 1,213
  • 3
  • 13
  • 25

2 Answers2

1

I think is possible with a UITableViewDelegate method: – tableView:willDisplayCell:forRowAtIndexPath:

you can set frame sizes, position, etc. Basically any layout should have effect there. or you can subclass UITableViewCell and override layoutSubviews: method (don't forget to call [super layoutSubviews]; first)

Actually I am doing the second approach and works excelent.

Hope this helps ;)

nacho4d
  • 43,720
  • 45
  • 157
  • 240
0

In my opinion, the right way is to redesigned the cell. 2 possibilities:

  • Programmatically in tableView:cellForRowAtIndexPath: (see iOS guide)
  • with a custom UITableCellView (see iOS guide)

And for the cell height: tableView:heightForRowAtIndexPath: of the delegate

Benoît
  • 7,395
  • 2
  • 25
  • 30