小编Kry*_*ter的帖子

Xcode 9 - iOS 11 UITableView行为空

自从新的iOS 11更新以来,我有一个应用程序将在模拟器和设备上显示空白的tableview行.甚至行分隔符也不会显示应该存在的任何行.如果我将模拟器更改为较旧的iOS版本,行将显示正常.没有对代码或故事板的更改.

行仍然有数据,这意味着我可以点击其中一个空行,它将执行代码并包含我期望的信息.

我看到其他场景,其中tableview放在一个视图上,我不使用内置文本标签工作正常.只是这个tableview类使用内置的文本标签.

这是我的tableview类的代码......

@interface BunkPickTableViewController ()

@end

@implementation BunkPickTableViewController

@synthesize appDelegate, delegate, bunkPassedValue;

- (void)viewDidLoad {

    [super viewDidLoad];

    UIView *backgroundView = [[UIView alloc] initWithFrame:self.view.bounds];

    appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    CAGradientLayer *bgLayer = [BackgroundLayer tanGradient];
    bgLayer.frame = self.view.bounds;
    [self.view.layer insertSublayer:bgLayer atIndex:0];

    self.tableView.backgroundView = backgroundView;

    [self.navigationController.navigationBar setTintColor:[UIColor blackColor]];

    self.title = @"Bunk Codes";

}

- (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];

    [[self navigationController] setNavigationBarHidden:NO animated:NO];

    [self.tableView reloadData];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

#pragma mark - Table view data source

- …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c ios11

7
推荐指数
1
解决办法
1365
查看次数

标签 统计

ios11 ×1

objective-c ×1

xcode ×1