我有一个TableViewController,它只是一个带有tableview的UIViewController
我将此表视图控制器添加到多个屏幕作为子视图控制器
一切正常,除了它的最后两行有时不可见
他们在那里,如果有一半是可见的,我能够看到部分数据
这是我的设置:
[super viewDidLoad];
_purchaseInvoiceListTable = (TableViewController *)[self.storyboard viewController:[TableViewController class]];
_purchaseDataSource = [[PurchaseInvoiceListDataSource alloc]init];
User *user = [self.userSettings getUserDetails];
[_purchaseDataSource setPurchaseSummaryInfo:[user purchases]];
[_purchaseDataSource setGroupDelegate:self];
[_purchaseInvoiceListTable setDataSource:_purchaseDataSource];
[_purchaseInvoiceListTable.view setFrame:_purchaseInvoiceListTableContainer.bounds];
[_purchaseInvoiceListTableContainer addSubview:[_purchaseInvoiceListTable view]];
[_purchaseInvoiceListTable willMoveToParentViewController:self];
[self addChildViewController:_purchaseInvoiceListTable];
[_purchaseInvoiceListTable didMoveToParentViewController:self];
_purchaseInvoiceListTableContainer.clipsToBounds = YES;
[_purchaseInvoiceListTable.tableView.layer setBorderColor:[UIColor clearColor].CGColor];
答案 0 :(得分:0)
在这种情况下,请尝试设置UITableView的contentInset
属性
[tableView setContentInset:UIEdgeInsetsMake(30, 0, 200, 0)];