Code Monkey home page Code Monkey logo

Comments (12)

bfeher avatar bfeher commented on July 1, 2024

Hi istep,

Could you provide some code and screenshots please?

Thanks!

from bfpaperbutton.

istep avatar istep commented on July 1, 2024

there is another problem.
if the button was added into a uiscrollview as a subview,
the button did not work too.
can i send the code to you by email?

from bfpaperbutton.

bfeher avatar bfeher commented on July 1, 2024

sure: [email protected]

from bfpaperbutton.

istep avatar istep commented on July 1, 2024

hi,bfeher,
the email was sent just now.please check it.

from bfpaperbutton.

bfeher avatar bfeher commented on July 1, 2024

I ran your code and the BFPaperButton works exactly as it should. I'm unable to reproduce your issue. Could you perhaps provide a gif or video of the issue?
istep

from bfpaperbutton.

istep avatar istep commented on July 1, 2024

the ripple will not occurs until you press it for a long time.

you can compare the button and the button on the left.
the left button's ripple will occurs quickly as long as you click it.

from bfpaperbutton.

bfeher avatar bfeher commented on July 1, 2024

That delay, which you also noticed on UITableViewCell is caused by the ScrollView delay content touches. UITableView's do this too. Also, buttons near the bottom of the screen get a delay added by the OS to help the OS recognize when a user wants to pull up the OS menu.

from bfpaperbutton.

bfeher avatar bfeher commented on July 1, 2024

Add this line to your code:
mScrollView.delaysContentTouches = NO;

That should let the button tap rapidly :)
However, be warned that now if a user tries to scroll your scrollview, if their finger lands on the button the scroll view will not scroll. That is why UIScrollView delays content touches, to give scrolling precedence.

from bfpaperbutton.

istep avatar istep commented on July 1, 2024

great!
the line code works in uiscrollview
but it does not work for UITableViewCell

from bfpaperbutton.

bfeher avatar bfeher commented on July 1, 2024

This isn't an issue with UITableViewCell but with UITableView.

It is also not a problem but the expected behavior.

You can change the same property delaysContentTouches for the table view.

This is the normal expected behavior for UIScrollView and UITableView (which are a subclass of UIScrollViews).

This is not a bug with BFPaperButton.

Any control nested in those two will have their touches delayed unless specified.

from bfpaperbutton.

istep avatar istep commented on July 1, 2024

i tried setting the same property delaysContentTouches for the table view. but it did not work

from bfpaperbutton.

bfeher avatar bfeher commented on July 1, 2024

You are correct. iOS wants you to delay touches in UITableView and UITableViewCell. It used to be a simple fix but has changed for iOS 7 and 8. It is now slightly more difficult to achieve the behavior you desire. Please see this Stack Overflow entry.

http://stackoverflow.com/questions/19256996/uibutton-not-showing-highlight-on-tap-in-ios7/26049216#26049216

edit- I personally tested this answer and found that it works. It removes the delay on content touches! Enjoy ;)

from bfpaperbutton.

Related Issues (20)

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.