Git Product home page Git Product logo

Comments (14)

andreamazz avatar andreamazz commented on July 16, 2024

Hard to tell without some code.

from ampoptip.

realsurfer avatar realsurfer commented on July 16, 2024

I forgot to add the correct markdown. I updated my post above.
I am simply using:

tooltip = [AMPopTip popTip];
tooltip.shouldDismissOnTap = YES;
[tooltip showText:@"Tap to become invisible." direction:AMPopTipDirectionUp maxWidth:200 inView:self.topScrollView fromFrame:self.topScrollView.frame];

I am also using auto layout.

from ampoptip.

andreamazz avatar andreamazz commented on July 16, 2024

It might be the fromFrame
Try to use a smaller frame within the scroll view.

from ampoptip.

realsurfer avatar realsurfer commented on July 16, 2024

Thanks! It was located on top of the refreshcontrol. I had to pull down the scroll view to see it.
I now tried to use self.navigationItem.titleView.frameas the fromFrame but it seems to get located about 60px below the navigation bar. Any ideas?

from ampoptip.

andreamazz avatar andreamazz commented on July 16, 2024

It really depends on where you want to show it. You can build your own frame anyway, so if you want to pin the poptip wherever you like, you can just build a 1x1 rect in the origin you best see fit.

from ampoptip.

realsurfer avatar realsurfer commented on July 16, 2024

It seemed to work if I placed it in self.navigationController.navigationBar.
Thanks for helping out!

from ampoptip.

andreamazz avatar andreamazz commented on July 16, 2024

πŸ‘

from ampoptip.

realsurfer avatar realsurfer commented on July 16, 2024

Just noticed that the tap gesture doesn't work then as the pop tip is outside the navigation bar view.

from ampoptip.

andreamazz avatar andreamazz commented on July 16, 2024

Can you post a screenshot pointing where you want to put the poptip?

from ampoptip.

realsurfer avatar realsurfer commented on July 16, 2024

If I set [[AMPopTip appearance] setOffset:30.]; when placing it in self.view it works, but shouldn't it calculate the correct position without an offset?

from ampoptip.

andreamazz avatar andreamazz commented on July 16, 2024

This should work:

[self.popTip showText:@"Hello!"
            direction:AMPopTipDirectionDown
             maxWidth:200
               inView:self.navigationController.view
            fromFrame:CGRectMake(self.navigationController.navigationBar.frame.size.width / 2, self.navigationController.navigationBar.frame.size.height + [UIApplication sharedApplication].statusBarFrame.size.height , 1, 1)];

from ampoptip.

realsurfer avatar realsurfer commented on July 16, 2024

Thanks! That did work, however the pop tip was placed about 30px below the desired location.
This did work perfectly
[tooltip showText:@"Hello!" direction:AMPopTipDirectionDown maxWidth:200 inView:self.navigationController.view fromFrame:self.navigationItem.titleView.frame];
and the gesture also works. Thanks once again!

from ampoptip.

realsurfer avatar realsurfer commented on July 16, 2024

Sorry, I forgot to remove my offset. Your code works perfectly!

from ampoptip.

andreamazz avatar andreamazz commented on July 16, 2024

Glad to hear that! Cheers πŸ‘

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.