ios - How to expand my table view cell? -


using code expand table view cell,but not working me.i know there thing wrong in code me find out.

![selectindex = -1;      // additional setup after loading view.  } -(nsinteger)numberofsectionsintableview:(uitableview *)tableview  {      return 1; } -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section {     return  \[arr_lbl count\]; } #pragma mark table cell creating , loading data -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {     antzclubcell *cell=\[tableview dequeuereusablecellwithidentifier:@"antz"\];     cell.img_antzclub.image=\[uiimage imagenamed:\[arr_img objectatindex:indexpath.row\]\];     cell.lbl_antzclub.text=\[arr_lbl objectatindex:indexpath.row\];     cell.accessorytype=uitableviewcellaccessorydetaildisclosurebutton;     cell.backgroundcolor=\[uicolor blackcolor\];     return  cell; } #pragma mark expanding height -(cgfloat)tableview:(uitableview *)tableview estimatedheightforrowatindexpath:(nsindexpath *)indexpath {     if(selectindex==indexpath.row){         return 400;     }     else{         return 132;     }  } #pragma mark user selecting option -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {     if (indexpath.row==selectindex) {          selectindex=-1;         \[tableview reloadrowsatindexpaths:\[nsarray arraywithobject:indexpath\] withrowanimation:uitableviewrowanimationfade\];         return;     }         if(selectindex !=-1)         {             nsindexpath *prepath=\[nsindexpath indexpathforrow:selectindex insection:0\];             selectindex=indexpath.row;             \[tableview reloadrowsatindexpaths:\[nsarray arraywithobject:prepath\] withrowanimation:uitableviewrowanimationleft\];         }         selectindex=indexpath.row;         \[tableview reloadrowsatindexpaths:\[nsarray arraywithobject:indexpath\] withrowanimation:uitableviewrowanimationfade\];     }] 

enter image description here image output while click cell merged other data not expanding.

depending on versions of ios want support answer may differ, seems didn't implement heightforrowatindexpath:


Comments