ios - Tableview not going bigger if expanding cell -


i've implemented thing click on cell or button , tableview cell expand. problem if expand last cell behind tableview. how can make resize tableview , move cell little?

i made constraints , views inside cell.

it looks this, blue 1 main 1 , black going expand.

enter image description here

i don't know code necessray how make expand.

this inside cellforrowatindexpath:

if (self.selectedindex == indexpath.row){                 self.selectedindex = -1             }else{                 self.selectedindex  = indexpath.row             }              self.productstable.beginupdates()             self.productstable.reloadrowsatindexpaths([indexpath], withrowanimation: uitableviewrowanimation.automatic)             self.productstable.endupdates()         }         return cell 

this inside heightforrowatindexpath:

if(selectedindex == indexpath.row){     return 210 }else{     return 135 } 

i tried detect last cell , move not working.

check code

func reloadchange() {      let indexpath = nsindexpath(forrow: selectedindex, insection: 0)      self.tableview.reloadrowsatindexpaths([indexpath], withrowanimation: uitableviewrowanimation.none)      //this way scroll last cell      self.tableview.scrolltorowatindexpath(indexpath, atscrollposition: .bottom, animated: true) }   func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) {      //code expand , shrink cell      if(self.selectedindex == indexpath.row)       {       self.selectedindex = -1       self.tableview.reloadrowsatindexpaths([indexpath], withrowanimation: uitableviewrowanimation.none)      //this way scroll last cell      self.tableview.scrolltorowatindexpath(indexpath, atscrollposition: .bottom, animated: true)         return       }     self.selectedindex = indexpath.row     self.reloadchange() } 

i hope helps


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -