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

Bug in the interaction regarding the small part that is not hidden #40

Closed
Ricardo1980 opened this issue Sep 1, 2016 · 7 comments
Closed

Comments

@Ricardo1980
Copy link

Ricardo1980 commented Sep 1, 2016

There are several bugs regarding gestures or interaction like:

#17
#20

The reason is because when we scroll a lot, the parallax contentView is outside screen and does not send taps to its subviews, even if they are displaced to be presented in the screen again.

You can see that using Reveal:
screen shot 2016-09-01 at 17 19 13

If we swap parallax.contentView.frame.origin.y and parallax.view.frame.origin.y then it works, but of course that only works in Reveal. Doing that we will see how the components that are in the small part (defined by parallaxHeader.minimumHeight) would work again.

I tried to modify the lib to do something like that, but no luck at the moment.
Does anyone have any idea? This would make the tiny part interactive, which is important.

@maxep
Copy link
Owner

maxep commented Sep 1, 2016

Thanks for your report. But I do not understand, the parallaxHeader's contentView never gets off the screen, only the height changed. Could you give a bit more context, where do you swap parallax.contentView.frame.origin.y and parallax.view.frame.origin.y? Maybe a sample project that reproduce the issue could help fixing this...

@Ricardo1980
Copy link
Author

Ricardo1980 commented Sep 1, 2016

Sorry, it is difficult to explain.
I created a video with your example modified (I only added a button to the bottom of the header and a couple of constraints, no code)

In the video you can see that it is possible to interact with the button (changes from blue to white) that is in the header, but once you scroll a lot, that is not possible. Not only that, but the tap is sent to the table and the cell is pressed, which is even worse. And if you don't use a component, it is also a problem, because taps will go to the table.

Using reveal I see that the parent view is outside the screen, perhaps that is the problem. In the second part of the problem I exchange the frame Y and as you can see, it works again the button.

https://vimeo.com/181096876

Example.zip

Not sure about what is the best solution.
Can you reproduce it?

@Ricardo1980
Copy link
Author

I forgot to say that I think that the problem is that the parent view of the header is outside the screen. Perhaps there is some kind of internal OS optimization and touches are not passed to children views.
I tried to overwrite hitTest in the custom header view and if you scroll a lot, hits are not received. But in the initial position, it works.

@Ricardo1980
Copy link
Author

@maxep Could you reproduce it? Thanks!

@maxep
Copy link
Owner

maxep commented Sep 5, 2016

Hi @Ricardo1980
Thanks for the project, yes i can reproduce. I need to investigate, from what I see It's only happening with table view, can you confirm ?

@dmacanas
Copy link

dmacanas commented Sep 21, 2016

Hi,

I'm also experiencing a similar issue with a UITableViewController. It was working on a previous build but now on 0.5.2 there seems to be an issue.

I have 2 buttons in the header that filter data in my application. It used to register the interaction correctly but now passes that down to the tableView:didSelectRow: delegate. I see this behavior only when I have scrolled pass the minimum height value.

View structure when first loaded and working correctly:
screen shot 2016-09-21 at 4 06 19 pm

View structure after scrolling and the interaction doesn't work:
screen shot 2016-09-21 at 4 00 57 pm

@maxep
Copy link
Owner

maxep commented Oct 5, 2016

Hi,
I looked deeper into that issue and I found out the problem. This bug and others (#43, #44, #17) comes from recent changes made to support table view with sections. When a parallaxheader is added to a table view, it sets the UITableView's tableHeaderViewproperty. But the tableHeaderView scrolls with the content and when scrolling up, the parallax header is drawn outside the bounds of the tableHeaderView, no touch is received. I will remove the support of table view sections waiting for a better solution.

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

No branches or pull requests

3 participants