tableView内のテキストが下にスクロールして再び表示されなくなります。プログラムで塗りつぶしたTableViewで画面をリフレッシュしない
そして、私のコードは次のとおりです。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [screenDefBuild.elementsToTableView count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier];
}
ScreenListElements *currentScreenElement = [screenDefBuild.elementsToTableView objectAtIndex:indexPath.row];
cell.textLabel.text = currentScreenElement.objectName;
currentRow++;
return cell;
}
- (void)viewDidLoad
{
[super viewDidLoad];
tableView = [[UITableView alloc] initWithFrame:self.view.bounds];
[tableView setDataSource:self];
[self.view addSubview:tableView];
}
私はまた、画面全体に私のテーブルビューを埋めたいです。 (上部に灰色のストラップ)。
これを非表示にする// if(cel == nil)....次に今スクロール – akk
これらのコメントはどちらも例外的に悪い考えであり、テーブルビューのいくつかのシステム最適化を壊します。 – jackslash
灰色のストラップの問題を解決するには、テーブルビューの背景色を白色にします。 – Charan