Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

suresh2mv

macrumors newbie
Original poster
Oct 9, 2010
3
0
HI friends

I have couple of problems with my UITableView.

1. When i add a UITableview on my page, by default it brings up some fixed number of rows. eventhough i set number of rows in section as 1. all the rows appears and except the first row, all are empty rows. So, i want to hide all the empty rows in the UItableview.

2.Based on the non-empty rows, i want to change the height of my UItableView.

i have been through web and not finding any proper answers..

Could someone help me with this, i badly need this.

thanks suresh
 
Just set the hight based on the number of elements in the datasource times however tall your cells are.

Other options:

Code:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
 --CALCULATE THE HEIGHT OF YOUR OWN CELL HERE RESIZE TABLEVIEW--
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.