0

早速質問です。UITableViewControllerカスタムセパレーターを持つカスタムセルを持っています(のUIImageViewサブビューであるとしてcell.contentView)。セルを選択しているときに、セパレーターを非表示にして、強調表示された背景に表示されないようにします。

私は次のような構造を使用しようとしていました:

self.separatorImageViewTop.frame = CGRectMake(-240, 0, 120, 2);        

self.separatorImageViewTop.hidden = YES;

self.separatorImageViewTop.alpha = 0;

[self.separatorImageViewTop.frame removeFromSuperview]

この方法はそれぞれ機能していますが、セルが選択されていると、それぞれがカスタムセパレーターに点滅効果をもたらしています。この点滅効果を回避するにはどうすればよいですか?

私のコードは次から呼び出されます:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

しかし、私は以下で使用しようとしました:

-(NSIndexPath*)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath

セルの実際の強調表示が UIImageView` の後に発生することを期待していますtableView:willSelectRowAtIndexPath: method, but the result are the same - still blinking effect of a disapearing

何か案は?

4

1 に答える 1

0

カスタムセルでこのメソッドをオーバーライドしてみてください:

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
于 2012-06-27T13:42:31.660 に答える