Code Monkey home page Code Monkey logo

Comments (4)

bfeher avatar bfeher commented on June 28, 2024

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.

from bfpapertableviewcell.

artworkad avatar artworkad commented on June 28, 2024

Thank you for this great explanation. I think UITableViewCellSelectionStyleDefault will be ok for me.

from bfpapertableviewcell.

bfeher avatar bfeher commented on June 28, 2024

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!

from bfpapertableviewcell.

artworkad avatar artworkad commented on June 28, 2024

@bfeher this is awesome, thank you 👍

from bfpapertableviewcell.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.