2014-02-06 45 views
-1

我有以下问题 我有在主视图中的一个按钮,如果我是点击该按钮在主视图的tableview 这里添加子视图是代码如何制作UITableview的确切高度?

FNsettingsViewController *fnsettings = [[FNsettingsViewController alloc]initWithNibName:@"FNsettingsViewController" bundle:nil]; 
fnsettings.delegate=self; 
[fnsettings.view setFrame:CGRectMake(0, 30, self.view.frame.size.width,250)]; 
[self.view addSubview:fnsettings.view]; 

后,我按一下按钮获得子视图为tableview,但其余部分有空白。

然后如何删除剩余的空格。

请任何人知道帮助我。

+1

组'fnsettings.backgroundColor = [的UIColor clearColor];' – Akhilrajtr

回答

-2

嗨,你可以尝试以下一个

//You can manage the height of a table view using this method. 
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath  *)indexPath 
{ 

// Return the height of the row what ever you want Like:below. 
return 50; 
} 

感谢

0

前值分配给泰伯维你会知道细胞计数吗?的尝试我的代码:

float height=[arrayTableValues count]*height of your single cell; 
tableview.frame=CGRectMake(0,30,self.view.frame.size.width,height);