아래로 스크롤하면 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) .... then scroll now – akk
이러한 주석은 모두 예외적으로 나쁜 아이디어이며 테이블 뷰에 대한 여러 가지 시스템 최적화를 무효화합니다. – jackslash
회색 스트랩 문제를 해결하려면 tableview 배경색을 흰색으로 지정하십시오. – Charan