uitableview - Swift tableView with 3 Prototype Cells and auto-height -


i have concept want realize in xcode. default tableviewcontroller 3 prototype cells.

cell 1 = name (prototype pages) cell 2 = seperator (prototype seperator) cell 3 = imageview (prototype seperator-with-only-image) 

cell 1 , cell 2 ok. need set height of "prototype seperator-with-only-image" cells auto. height should calculated based on added image dimensions.

here mockup

enter image description here

addional info: "prototype seperator-with-only-image" can occur multiple times , dimensions of images can vary.

any ideas how can achieve this?

you can set tableview's rowheight equal uitableviewautomaticdimension in viewdidload method:

    self.yourtableview.rowheight = uitableviewautomaticdimension     self.yourtableview.estimatedrowheight = 42.0 

here telling tableview calculate dimension of row. saying estimate row have height of 42, setting minimum height.

i think this great example using demo app.


Comments

Popular posts from this blog

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -