appsome / AccordionView

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

Breaks if the header is a UIView instead of a UIButton #7

Closed RobertAudi closed 10 years ago

RobertAudi commented 10 years ago

I tried to set the header of each accordion section to a subclass of UIView with UIImage and UILabel subviews, and the accordion (kind of) breaks: Can't switch between sections.

RobertAudi commented 10 years ago

OK I found a solution to the problem: Create a UIButton and add the custom view as a subview of the button. Work normally this way.

I'll keep this open because I believe that the docs should be updated to specify how to achieve the task described above.

suda commented 10 years ago

Detecting touching the header is done by adding AccordionView as target for UIControlEventTouchUpInside event. This is why header should inherit UIControl. It should be mentioned in docs or forced by code thou. Will fix it.