6

テーブルビューセルにその角の三角形を描画するスニペット(またはクラス/ライブラリ)を見た人はいますか(下の画像を参照)。

ここに画像の説明を入力してください

4

3 に答える 3

4

画像から新しいビューを作成し、それをaddSubviewを呼び出してセルに追加できます。起動時にコーナーを設定する例を次に示します。

- (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];

        CGRect cornerFrame = CGRectMake(x, y, width, height);
        UIImageView * corner = [[UIImageView alloc] initWithFrame:cornerFrame];
        [corner setImage:[UIImage imageNamed:@"corner.jpg"]];

        [cell.contentView addSubview:corner];
    }

    return cell;
}
于 2011-12-02T21:28:06.063 に答える
0

それはおそらくセル内の単なる画像です。派手すぎず、あなたの標準的なカスタムの実行ですUITableViewCell

于 2011-12-02T21:27:14.317 に答える