appsome / AccordionView

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

Using AccordionView with AutoLayout #24

Closed nor0x closed 9 years ago

nor0x commented 9 years ago

Hello,

I set up an AccordionView in Storyboard with AutoLayout and various constraints (Size Classes enabled). When I launch the app the width of the screen and the constraints are not applied to the AccordionView. The titles in the header buttons are centered inside the buttons - as the width is set via constraints the titles are cut off as seen on the screenshot.

ios simulator screen shot 24 aug 2015 22 15 15

Maybe you can help me with that? Thank you

nor0x commented 9 years ago

Solved it - I moved the initialization code of the accordion from viewDidLoad to viewDidAppear.

viewDidLoad is executed before constraints are applied from storyboard and viewDidAppear is executed after this process, for everyone with a similar problem.

Thanks