0
我有一个TableViewController这仅仅是一个在tableview中的UIViewController它的UITableView底部行的arent可见
我这个表视图控制器添加到多个屏幕作为一个子视图控制器
一切运作良好,除了事实上,在过去的2排的话,有时不可见
它们的存在,如果它的一半是可见的,我能看到的数据
的一部分,这是我的设置:
[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];
根据您_purchaseInvoiceListTableContainer的大小/帧上,下面的“_purchaseInvoiceListTableContainer .clipsToBounds = YES;“如果帧太大,可能会使溢出不可见。很显然,如果框架/界限超出屏幕范围,那么它也不可见,但从您提供的代码片段中看不出来。 ;) –
尝试通过设置[tableView setContentInset:UIEdgeInsetsMake(20,0,50,0)]; –
@Shan把你的答案我会接受,50是不够的,200的伎俩。谢谢 –