1

This has been frustrating me for the past two days now...

I have a custom navigation controller that consists of a UICollectionView that holds a UITableViewController in each of it's cells.

The effect I'm hoping to achieve is this:

This is how the nav "should" look

I'm using Voltron to manage the UITableViewControllers within the UICollectionViewCells and it seems to work nicely.

Here's my view structure (simplified):

-- WMLCollectionView ( Subclass of UICollectionView from Voltron)
   +-- WMLCollectionViewCell
   |   `-- UIView
   |       `-- UITableView
   |           +-- UITableViewWrapperView
   |           |   `-- VenueCell
   |           |       +-- UITableViewCellContentView
   |           |       |   +-- UIImageView
   |           |       |   +-- UILabel
   |           |       |   `-- UILabel
   |           |       +-- _UITableViewCellSeparatorView
   +-- WMLCollectionViewCell(
     # ...

The problem

This works well in the sandbox shown in the animation I've uploaded, but in my real world app, it's not working as I hoped. The UITableView controllers and their cells are built using Interface builder.

When I click to "zoom out" and scroll from one controller to another, the content within the UITableViewCell (the UIImageView and the 2 UILabels) don't scale down to resize with it. The cells become disproportionate in their scaled down UITableView containers.

Can anybody suggest how I can get the content of the UITableViewCells to scale down with the UITableViews?

bodacious
  • 6,608
  • 9
  • 45
  • 74
  • Could you set the height of the cells to a proportional height of the table view? – Hayden Holligan Nov 27 '15 at 17:10
  • That's what I've done in the image I uploaded - using `tableView:heightForRowAtIndexPath`. This doesn't work on my live app though, presumably because I'm using Interface Builder? – bodacious Nov 27 '15 at 17:16
  • I don't know the answer to your question... but, could I ask which app did you use to create your animated GIF? – vacawama Nov 27 '15 at 17:21
  • LICEcap http://licecap.en.softonic.com – bodacious Nov 27 '15 at 17:22
  • Thanks! Sometimes an animation is worth a thousand words. – vacawama Nov 27 '15 at 17:24
  • Reading https://stackoverflow.com/questions/8615862/custom-cell-row-height-setting-in-storyboard-is-not-responding might help. Are your cells static or prototypes? – Hayden Holligan Nov 27 '15 at 17:24
  • 1
    Use a transform to make the tableviews smaller rather than changing the frame. – James P Nov 28 '15 at 15:21
  • @JamesP — thanks. I tried using a transform but this just gives a weird warped size, where the tableView height is scaled correctly, but the width is half of what it should be. (using `tableView.transform = CGAffineTransformMakeScale(0.6, 0.6);`) – bodacious Nov 29 '15 at 15:57

0 Answers0