Tuesday 15 April 2014

ios - Autoresize cell xib to tableview cell width and row height -



ios - Autoresize cell xib to tableview cell width and row height -

i working custom tableviewcell xib , want size of automatically resized tableview's width , it's row's height.

the size of cell's view not auto adjusts tableview. have tried alter frame within tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) delegate no changes reflected (if print frame size before , after in fact change.)

does know solution this? best case create cell's frame auto adjust tableview's width , row height.

edit: after farther exam problem has ios8 size classes. when resize cell within xib, expand greater width table view's size. label supposed in center (had set them constraints , programmatically, got same results).

here's screenshot:

found problem, , mistake. never set constraints tableview within viewcontroller, maintained default base of operations size defined size classes introduced in ios 8.

that why width of cell expanded double of view controller's width.

ios iphone uitableview swift

No comments:

Post a Comment