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

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -