Git Product home page Git Product logo

Comments (9)

andreamazz avatar andreamazz commented on August 15, 2024 1

The poptip behaves like a common UIView, so you just need to take the contentOffset of your scrollview in consideration when presenting it (use the offset to offset the tip's frame). I'm using it in table views (which are scrollviews) without any issue.

from ampoptip.

MincDev avatar MincDev commented on August 15, 2024 1

AMPopTip.m?
You're still using the Objective-C version? That code is really old, you should move to the latest release, which has the appropriate constrainInContainerView property to skip that check.

Ah, thanks mate! This all makes perfect sense now. :)

from ampoptip.

matheushenriquesantos avatar matheushenriquesantos commented on August 15, 2024

Hi @andreamazz , can you show the piece of code?

from ampoptip.

MincDev avatar MincDev commented on August 15, 2024

@andreamazz Please provide code. I have been struggling for over 2 hours with this issue. My poptip shows perfectly in the initial view of the scrollview. Anything outside of the initial view will have the poptip jump to the top part of the scrollview

from ampoptip.

alph0x avatar alph0x commented on August 15, 2024

Hi @MincDev, this isn't a issue at all, I was just mistaken back then, remember that the frame that points the popView and the View that is going to show it, doesn't have to be the same, use the scrollView you want to pop it.

from ampoptip.

andreamazz avatar andreamazz commented on August 15, 2024

@andreamazz Please provide code. I have been struggling for over 2 hours with this issue. My poptip shows perfectly in the initial view of the scrollview. Anything outside of the initial view will have the poptip jump to the top part of the scrollview

If I understand this correctly you want to show the tip on a scrollable view, and have the tip follow the scrolling instead of staying put, correct? Let me concoct a quick sample, BRB

from ampoptip.

andreamazz avatar andreamazz commented on August 15, 2024

Scroll.zip

Here. As you can see the tip is shown in the scrollview. Consider that show just calls addSubview to the view that you pass in the in parameter, the from frame is used just to adjust the position in relation to that view. Treat it as you would treat a common UIView

from ampoptip.

MincDev avatar MincDev commented on August 15, 2024

Scroll.zip

Here. As you can see the tip is shown in the scrollview. Consider that show just calls addSubview to the view that you pass in the in parameter, the from frame is used just to adjust the position in relation to that view. Treat it as you would treat a common UIView

No, the problem was that if I wanted to show the tooltip and the screen has been scrolled down from the original loading state, the tooltip would display at the top, outside of the current view. As if the part of the scrollview currently being shown does not exist. However I was able to fix this issue by commenting out the following in your code. (I only commented this out, because I don't know if it may break something else, but seems to be working perfectly now) - My poptip scrolled perfectly with my scrollview but when trying to show the poptip on a view which is not in the initially loaded scrollview frame, caused the issue.

if (y + frame.size.height > self.containerView.bounds.size.height) { y = self.containerView.bounds.size.height - frame.size.height - self.edgeMargin; } - Line 145 of AMpopTip.m

This part of the code didn't make sense to me as it kept on overriding my offsetBy method. Taking it out, allowed me to put the poptip anywhere I wished. However, if you know whether this may cause other issues, please let me know.

from ampoptip.

andreamazz avatar andreamazz commented on August 15, 2024

AMPopTip.m?
You're still using the Objective-C version? That code is really old, you should move to the latest release, which has the appropriate constrainInContainerView property to skip that check.

from ampoptip.

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.