Closed artworkad closed 10 years ago
Hi ArtworkAD!
Because BFPaperTableViewCells do their own background highlighting, in their constructor I purposely set their selectionStyle
to UITableViewCellSelectionStyleNone
which is causing the behavior you describe.
If you are ok with the highlight looking a bit different, you can set
cell.selectionStyle = UITableViewCellSelectionStyleDefault;
in cellForRowAtIndexPath, or wherever you setup your cells, to bring back this behavior (similar to the Settings app).
If you are talking about adding a feature to BFPaperTableViewCell so that it's background fade remains upon selection and goes away on deselection, well I never thought of this. I'm not technically selecting or highlighting the cell, just drawing a layer on it. Also, cell selection is often handled by the tableView, not the cell itself.
However you have sparked my interest; I suppose I could override setSelected
, setHighlighted
, and prepareForReuse
to imitate this kind of effect.
I'll let you know if I get this working nicely.
Thank you for this great explanation. I think UITableViewCellSelectionStyleDefault
will be ok for me.
Hello again,
I've pushed version 1.3.0 which now has two new properties:
CGFloat backgroundFadeAlpha
&
BOOL letBackgroundLinger
(default YES).
Also now you no longer need to set cell.selectionStyle = UITableViewCellSelectionStyleDefault;
because the background will linger until the cell is de-selected. You should find that it behaves just like the standard UITableViewCell in a standard UITableViewController.
Please let me know if you find any bugs. Thanks for suggesting this feature!
@bfeher this is awesome, thank you :+1:
Using
UITableViewCell
you get this effect when you first click on a cell, segue to another view and move back again. The cell is still selected and the selection state fades out animated. You can see it in the iPhone Settings app very clearly.I noticed that
BFPaperTableViewCell
is not behaving that way. Are there plans to implement that?