appsome / AccordionView

Simple accordion view in Cocoa Touch
Other
144 stars 38 forks source link

Weird behaviour when accordion is in a UIScrollView #9

Closed RobertAudi closed 9 years ago

RobertAudi commented 10 years ago

If there are too many sections to fit of the screen, the bottom sections will be hidden and unreachable. The solution is obviously to put the accordion in a UIScrollView. The problem is that if a section is open and at the top of the screen, its header stays at the top of the screen but its view keeps scrolling up. I don't know how to fix this (yet) but I'm looking into it.

Also, if the user touches the header while trying to scroll, the view won't scroll; the user has to scroll by touching the section's view. I don't know how to fix this problem either, and I suspect it's a harder problem, but I will look into it as well.

I attached a screenshot showing the first problem. uiscrollview bug

suda commented 10 years ago

@AzizLight sorry for very long time to reply.

AccordionView uses UIScrollView internally so you don't have to put it in another one. Overlapping header is "by design" and it's inspired by UITableView's behavior. In your case I would recommend to change header's background to white and tweak styles a little bit so it would look like the header is on top of section.