4

iOS 7 で編集モードに入るUITableViewと、セルの内容が削除ボタンと重なってしまいます。 ここに画像の説明を入力

iOS7 の質問で、編集モードのときに UITableViewCell のコンテンツが削除ボタンと重複していることを確認しましたが、私の場合は役に立ちません。

メソッドでセルをtableView:cellForRowAtIndexPath動的に作成しています。

この問題に対するあなたのアイデアがあれば教えてください。

4

3 に答える 3

0

私は実際にこの完全な実装を使用して、すべてが見栄えがするようにします。

- (void)layoutSubviews
{
[super layoutSubviews];

self.contentView.frame = CGRectMake(0,
                                    self.contentView.frame.origin.y,
                                    self.contentView.frame.size.width,
                                    self.contentView.frame.size.height);

if ((self.editing
    && ((_state & UITableViewCellStateShowingEditControlMask)
        && !(_state & UITableViewCellStateShowingDeleteConfirmationMask))) ||
    ((_state & UITableViewCellStateShowingEditControlMask)
     ))
{
    float indentPoints = self.indentationLevel * self.indentationWidth;
    self.contentView.layer.masksToBounds = YES;
    self.contentView.frame = CGRectMake(50,
                                        self.contentView.frame.origin.y,
                                        self.contentView.frame.size.width - indentPoints,
                                        self.contentView.frame.size.height);
}


if ((self.editing
    && (_state & UITableViewCellStateShowingDeleteConfirmationMask)))
{
    float indentPoints = self.indentationLevel * self.indentationWidth;
    self.contentView.frame = CGRectMake(50,
                                        self.contentView.frame.origin.y,
                                        self.contentView.frame.size.width - indentPoints - 30,
                                        self.contentView.frame.size.height);
}
}
于 2013-11-12T11:25:14.450 に答える
0

cellForRowAtIndexPath (デリゲート メソッド) でセルのセル setBackgroundImage を設定している可能性があります。ここでは設定しないでください。画像を次の場所に設定します。

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"cellList.png"]]; }
于 2013-12-11T12:46:45.293 に答える
0
- (void)layoutSubviews
{
 [super layoutSubviews];



self.contentView.frame = CGRectMake(0,
                                    self.contentView.frame.origin.y,
                                    self.contentView.frame.size.width,
                                    self.contentView.frame.size.height);



if ((self.editing
    && (_state & UITableViewCellStateShowingDeleteConfirmationMask))){
    float indentPoints = self.indentationLevel * self.indentationWidth;
    self.contentView.frame = CGRectMake(50,
                                        self.contentView.frame.origin.y,
                                        self.contentView.frame.size.width - indentPoints - 30,
                                        self.contentView.frame.size.height);
 }
}
于 2013-11-12T11:21:59.010 に答える