小编ser*_*991的帖子

iOS7动态更改UITableView高度

请帮我提一下这个问题.我尝试了所有可以在这里找到的选择.

附上我的代码示例(我知道,它非常糟糕).
如何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
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

ios ×1

objective-c ×1

uitableview ×1