首页 > 解决方案 > tabbarcontroller 中的表格视图滚动问题

问题描述

我正在使用 tabbarcontroller,并且在导航控制器中嵌入了 tabbarcontroller 的 childcontoller。我在 childcontroller 中使用滚动视图,底部是我的 tableview。滚动到底部,数组中有 5 个元素的 tableview 仅显示 2 个元素。在此处输入图像描述

我已经尝试过这段代码来管理滚动视图中表格视图的高度

{

[超级视图DidLoad];

int height =_PreviousComplaintArray.count*77;

_tableView.frame=CGRectMake(_tableView.frame.origin.x, _tableView.frame.origin.y,      

_tableView.frame.size.width,height);

[_tableView 重载数据];

}

-(void)viewDidLayoutSubviews

{

[self.tableView layoutIfNeeded];

self.tblhght.constant = self.tableView.contentSize.height+50;

NSLog(@"size is %d",self.tblhght.constant);

}

标签: iosuitableviewuiscrollviewuitabbarcontroller

解决方案


推荐阅读