Cha*_*har 55 objective-c cell uitableview detailtextlabel
detailTextLabel不可见(代码如下).你能告诉我为什么吗?
// Customize the appearance of table view cells.
- (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] autorelease];
}
// Configure the cell...
NSString *cellValue = [myListArray objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
cell.detailTextLabel.text = @"Hello "; // This is not visible
cell.image = [myListArrayImages objectAtIndex:indexPath.row];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
小智 128
将detailTextLabel不显示cells与UITableViewCellStyleDefault风格. init在UITableViewCell与UITableViewCellStyleSubtitle替代,你应该看到你的detailTextLabel.
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26559 次 |
| 最近记录: |