iphone - I would like to increase the rowHeight as I add new cells to UITableView -


i 1 cell rowheight equal height of uitableview. add add new cells, rowheight divided total amount of cells have.

in viewdidload set default height. have:

mycellheightnum = [[nsnumber alloc] initwithint:100]; //not sure how height of uitableview set 100 

in -(ibaction) addcell method have:

[mytableview beginupdates]; double value = [mycellheightnum doublevalue]; mycellheightnum = [nsnumber numberwithdouble:value * value / numofcells];  [mytableview reloaddata];    

idk, ideas.

thanks,

ben

write function

-(cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath {   double value = [mycellheightnum doublevalue];   mycellheightnum = [nsnumber numberwithdouble:value * value / numofcells];   return [mycellheightnum floatvalue]; } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -