新しいiOS 11のアップデート以降、シミュレータとデバイスに空白のテーブルビュー行を表示するアプリがあります。行区切り記号は、そこに存在するはずの行のいずれにも表示されません。シミュレータを古いiOSバージョンに変更すると、行が正常に表示されます。コードやストーリーボードに変更はありません。Xcode 9 - iOS 11 UITableViewの行が空です
行にはまだデータがあります。つまり、空白の行の1つをタップすると、コードが実行され、予想していた情報が含まれます。
テーブルビューがビュー上に配置されていて、内蔵のテキストラベルを使用していない他のシーンは正常に動作しているようです。組み込みのテキストラベルを使用するこのテーブルビュークラス。ここで
は、テーブルビュークラスの私のコードです...
@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
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [appDelegate.bunkArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.textLabel.textAlignment = NSTextAlignmentCenter;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.backgroundColor = [UIColor clearColor];
}
Bunk *bunkObj = [appDelegate.bunkArray objectAtIndex:indexPath.row];
cell.textLabel.text = bunkObj.bunkId;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
Bunk *bunkObj = [appDelegate.bunkArray objectAtIndex:indexPath.row];
[delegate dismissBunkPop:bunkObj.bunkId];
[self.navigationController popViewControllerAnimated:YES];
}
@end
コードをステップ実行すると、 'cell.textLabel.text'は正しい値を取得しますか? – Koen
それは、私はブレークポイントし、正しい数の行が正しい情報を取得していることを確認しました。すべてがよさそうだ。 – Kryckter
私はios10で完全に動作するプロジェクトで同様の問題を抱えています(すべてのセルが空白になり、グループタイトルのみが正常です)。私はそれを見ている。 – ZDidier