iOS 7 で編集モードに入るUITableView
と、セルの内容が削除ボタンと重なってしまいます。
iOS7 の質問で、編集モードのときに UITableViewCell のコンテンツが削除ボタンと重複していることを確認しましたが、私の場合は役に立ちません。
メソッドでセルをtableView:cellForRowAtIndexPath
動的に作成しています。
この問題に対するあなたのアイデアがあれば教えてください。
iOS 7 で編集モードに入るUITableView
と、セルの内容が削除ボタンと重なってしまいます。
iOS7 の質問で、編集モードのときに UITableViewCell のコンテンツが削除ボタンと重複していることを確認しましたが、私の場合は役に立ちません。
メソッドでセルをtableView:cellForRowAtIndexPath
動的に作成しています。
この問題に対するあなたのアイデアがあれば教えてください。
私は実際にこの完全な実装を使用して、すべてが見栄えがするようにします。
- (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);
}
}
cellForRowAtIndexPath (デリゲート メソッド) でセルのセル setBackgroundImage を設定している可能性があります。ここでは設定しないでください。画像を次の場所に設定します。
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"cellList.png"]]; }
- (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);
}
}