【发布时间】:2014-03-29 23:48:51
【问题描述】:
请帮我问这个问题。我尝试了所有可以在这里找到的选择。
附上我的代码示例(我知道,这很糟糕)。
如何动态更改UITableView 高度?
- (void)viewDidLoad
{
[super viewDidLoad];
[self vozvratmassiva];
}
- (NSMutableArray *) vozvratmassiva
{
...
return array;
}
-(NSInteger)numberOfSectionInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSArray *a = [self vozvratmassiva];
return a.count;
}
-(UITableViewCell *)tableView:(UITableView *) tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
....
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
....
return commonsize;
}
@end
【问题讨论】:
-
你想动态改变tableView的高度还是单元格的高度。
-
我想改变tableView的常用尺寸。我确实已经改变了单元格的高度。
-
我认为这个答案应该更符合您的要求stackoverflow.com/a/18784825/457998
-
@chintanadatiya 哦哦!你这个摇滚人!谢谢!现在可以了!
标签: ios objective-c uitableview