Git Product home page Git Product logo

Comments (5)

davdroman avatar davdroman commented on July 19, 2024

Hi.

I'd need more info to evaluate your issue. Are you using DRPageScrollView? If so, did you enable page reuse?

from popsicle.

davdroman avatar davdroman commented on July 19, 2024

Hey @hsavit1 did you finally get around with this issue?

from popsicle.

hsavit1 avatar hsavit1 commented on July 19, 2024

Yea I never figured it out actually.

The Button loses its functionality on the second and third pages of the
view pager. Will keep you posted if I come up with something

On Monday, June 8, 2015, David RomΓ‘n [email protected] wrote:

Hey @hsavit1 https://github.com/hsavit1 did you finally get around with
this issue?

β€”
Reply to this email directly or view it on GitHub
#13 (comment)
.

Sent from Gmail Mobile

from popsicle.

davdroman avatar davdroman commented on July 19, 2024

@hsavit1

Oh my. I just came up with what that's about. Since the page view where the button is contained is out of bounds but the button is still visible, it won't receive touch events. It's a default behavior every UIView component has: they ignore touch events when they're out of bounds from their parent superviews.

Check out this official document from Apple where they explain how to get around it: https://developer.apple.com/library/ios/qa/qa2013/qa1812.html

If for some reasons the existing layout has to be maintained, you can change the hit-testing behavior of the parent view so that it doesn't ignore the touch events. This can be done by overriding the -(UIView *)hitTest:withEvent: method of the parent view's class.

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {

    // Convert the point to the target view's coordinate system.
    // The target view isn't necessarily the immediate subview
    CGPoint pointForTargetView = [self.targetView convertPoint:point fromView:self];

    if (CGRectContainsPoint(self.targetView.bounds, pointForTargetView)) {

        // The target view may have its view hierarchy,
        // so call its hitTest method to return the right hit-test view
        return [self.targetView hitTest:pointForTargetView withEvent:event];
    }

    return [super hitTest:point withEvent:event];
}

from popsicle.

hsavit1 avatar hsavit1 commented on July 19, 2024

hey, forgot to respond to this

looks neat! will check out

from popsicle.

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.