Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't support custom view with AutoLayout? #59

Closed
LiweiDong opened this issue Jan 16, 2016 · 23 comments
Closed

don't support custom view with AutoLayout? #59

LiweiDong opened this issue Jan 16, 2016 · 23 comments

Comments

@LiweiDong
Copy link

No description provided.

@andreamazz
Copy link
Owner

Please provide more context...

@erdem-inan
Copy link

Hi,
I have also a problem with a custom view. When calling showCustomView, nothing is showed up on the screen. I used AutoLayout for the custom view, this why a post a message here.

I am trying to show an PopTip with custom view after selecting a cell of a UICollectionView, but nothing is showed up.
What information do you need for debugging ?
(Sorry for my bad english.)

@andreamazz
Copy link
Owner

By nothing you mean the content or the whole popTip? If you don't see the bubble it may be due to wrong coordinates passed in the fromFrame param.
Can you post some of the code you are using?

@erdem-inan
Copy link

Here the code i use:
let convertRect = cell.convertRect(cell.bounds, toView: calendar)
popTip.showCustomView(dayPeriodView, direction: .Down, inView: calendar, fromFrame: convertRect)

When calling showText like this (for testing)
popTip.showText("Test", direction: .Down, maxWidth: 100, inView: calendar, fromFrame: convertRect)
everyThing is showing fine and the popTip is at the right place.

@erdem-inan
Copy link

Sorry i forgot to say:
By Nothing, i mean the whole popTip is not showed up.

@andreamazz
Copy link
Owner

Can you log the popTip's frame once you presented it?

@erdem-inan
Copy link

Yes, it has a frame of (0,0,0,0)
I try to place a frame (for test) like this
popTip.frame = dayPeriodView.frame
but it didn't work as well.

@andreamazz
Copy link
Owner

Yeah, it's probably autolayout then. I reckon it's guessing the custom view's frame before autolayout did his thing.

@erdem-inan
Copy link

Ok then, Do you have a quick fix for now or something else ?

andreamazz added a commit that referenced this issue Jan 25, 2016
@andreamazz
Copy link
Owner

Checkout latest commit. It's a wild guess, but who dares wins.

@erdem-inan
Copy link

Ok thanks, I will try it now.

@erdem-inan
Copy link

Sorry, but it didn't work.

@andreamazz
Copy link
Owner

Can you reproduce the issue in the sample project by any chance?

@erdem-inan
Copy link

yes I can try, i will try it now.

@erdem-inan
Copy link

So I can reproduce it by adding my custom view in your sample project.
Dumb question: Can I give it to you like that? if yes, how do we proceed ?

@andreamazz
Copy link
Owner

Dunno, if you want you can send it at [redacted]

@erdem-inan
Copy link

I just send you the popTipDemo modified :) on [redacted]

@erdem-inan
Copy link

Any news on that bug ? :)

@andreamazz
Copy link
Owner

Yeah, I figured out what's breaking stuff (layoutSubviews gets convulsively called), but I still need to figure out how to stop the madness. In the meantime you can ditch autolayout for that view (there's not much reason to use it for a simple view that does not need to scale)

@erdem-inan
Copy link

Ok thanks !
let me now if you find a solution :)

@songjisj
Copy link

set poptip.translatesAutoresizingMaskIntoConstraints = false works for me

@andreamazz
Copy link
Owner

Hi all. Sorry for the delay. Can you test again the issue now that #66 is merged in?

@andreamazz
Copy link
Owner

This should be fixed on master. Reopen if you need further assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants