0

I am using TTTableViewController class. I have added the UIView of height 100 to the Table cell initially. The height of UIView changes dynamically and I have to change the height of cell also. But height of the cell doesnt chnages. please remember I am ?Using Three 20. Thanks in advance for valuable response.

一二三
  • 21,059
  • 11
  • 65
  • 74
Ravi Nalawade
  • 11
  • 1
  • 5

3 Answers3

0

For TTTableViewCell

do it in didLoad or init method

    self.variableHeightRows = YES;

and use the below function.

    + (CGFloat)tableView:(UITableView*)tableView rowHeightForObject:(id)object;
       {
           return 80; //value can be changed
        }
Ajeet Pratap Maurya
  • 4,244
  • 3
  • 28
  • 46
0

Have you Enabled this while creating row Dynamically??

BOOL variableHeightRows = YES

You can refer this link, hope it may help you. :))

Or try this :-

-(CGFloat)tableView :(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
 {
   // return (the value for the row)
 }

but for this you must implement its Delegate i.e. UITableViewDataSource.

mAc
  • 2,434
  • 2
  • 22
  • 39
0

use the below delegate method to adjust table row height.

-(CGFloat)tableView :(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 50; //the required table row height
}
Justin
  • 84,773
  • 49
  • 224
  • 367
Rajesh
  • 764
  • 8
  • 16