が、私は方法- (void)viewDidLoad
でのtableViewのcontentInsetを設定して変更し、プロパティがtableView.contentInset
がに自動に変更されます、しかしself.tableView.contentInset = UIEdgeInsetsMake(200, 0, 200, 0);
です:これが起こっ{64, 0, 0, 0}
.Why、そしてどのように私はこの問題をsloveすることができますか?のUITableView contentInsetは
環境:XCode8.1 iOS10.1
#import "YAVideoViewController.h"
static NSString * const ID = @"cell";
@interface YAVideoViewController()
@end
@implementation YAVideoViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor arcColor];
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:ID];
self.tableView.contentInset = UIEdgeInsetsMake(200, 0, 200, 0);
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 50;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID forIndexPath:indexPath];
cell.textLabel.text = [NSString stringWithFormat:@"第%ld个cell",indexPath.row];
return cell;
}
@end
同じことは、ViewControllerの属性インスペクタでチェックを外すことができます。 – user2071152