3

左の画像のようなグループ化された UITableView を iPhone OS 3.0 で作成しました。その結果が、OS 3.1 の正しいイメージです。

imageView はセパレーターの下にあります。

コンテンツビューを前面に配置しようとしました。tableView がグループ化されたスタイルの場合 (自分でセパレーターを描画するため)、separatorStyle の妥当性は無視されるようです。セパレーターの色を変更すると、文字列の結果が得られます。

ご協力いただきありがとうございます!

編集:これは変更されていないコードです:

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.font = [UIFont boldSystemFontOfSize:18.0];
}

cell.textLabel.text = [[metro.arretDirection objectAtIndex:indexPath.row] name];

NSString* name;
if (indexPath.row == 0) {
    name = @"Begining";
}
else if (indexPath.row + 1 == [metro.arretDirection count]) {
    name = @"End";
}
else {
    if ([[[metro.arretDirection objectAtIndex:indexPath.row] lines] count]== 1) name = @"Little";
    else name = @"Big";
}

UIImage* metroImage = [[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%i%@.png", metro.metroNumber, name]]];
cell.imageView.image = metroImage;
[metroImage release];

return cell;
4

2 に答える 2

1

答えは実際には非常に簡単UIImageViewでした。組み込みの imageView を使用する代わりに、適切な場所に をセルに追加するだけです。

于 2011-05-14T16:00:40.680 に答える
1

セルでclipsToBoundsを NO に設定してみてください。例えばcell.clipsToBounds = NO;

于 2011-01-02T14:25:42.127 に答える