好吧我不知道为什么这不起作用,但我已经连接了一个tableView,我想要为每个单元格设置19项文本.
单元格填充得很好,但是当我尝试滚动时,它会向下移动,我可以看到在初始视图中看不到的单元格,它会挂起,并且不会向下滚动.它只是快速回复.真的很奇怪!
我究竟做错了什么?
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return 19;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
if(indexPath.row == 0){
cell.textLabel.text = …Run Code Online (Sandbox Code Playgroud)