iphone - Dynamically set UIScrollView height and UITableView Height depending on content -
i'm bit of iphone noob here, please bare me.
setup: have scrollview label, uiimage, , tableview (grouped) nested within. label, uiimage, , tableveiw populated webservice. last section in grouped table view contains text never same , long 5 characters 250+. also, view pushed basic tableview (so has navigation bar. if matters @ all).
expected: tableview should extend in height depending on length of content received web service. set scrollview height accommodate height of tableview
problem: i'm not quite sure how approach issue. know how change height fixed values, not work in many scenarios.
any appreciated. thank you.
the width , height of cell ignored; cell cell re-sized according value return -tableview:heightforrowatindexpath: or (failing that) tableview.rowheight. might appear if cell big enough if label in cell sized big enough, because label allowed bigger (and render outside) cell.
one way override -tableview:heightforrowatindexpath: return correct height. isn't intended use of uitableview (it's designed lots of rows of single height, dynamically generated list of content).
another way set tableview.tablefooterview = mycustomfooter instead. easiest way. size correctly before performing assignment (the height matters; table view set width anyway). make sure autoresizing flags not set, or size appear randomly change when table view changes size (e.g. on autorotation).
Comments
Post a Comment