appsome / AccordionView

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

Close Accordion On Start #2

Closed SpoonIsBad closed 11 years ago

SpoonIsBad commented 12 years ago

Great work, I had no issue implementing/customizing the accordion to my needs. Thank you!

However, there is one problem I can't seem to fix. Is it possible to have the accordion start closed, instead of showing the first view (view1) open on start up? I noticed in my ViewController both "view1" and view2" are set up the same so I've been trying to mess around with some values (selectionIndexes) in AccordionView.m, but haven't had any luck.

Could anyone push me in the right direction here?

Thanks!

--- EDIT ---

Nevermind, you can control this with

if ([selectionIndexes count] == 0) { [self setSelectedIndex:0]; }

Duh!

burakkilic commented 11 years ago

Hi @SpoonisBad;

I tried your solution after initialising the Accordion but still it is not closed. What is wrong?

SpoonIsBad commented 11 years ago

Hi, sorry I'm out of the office until Monday, so I can't pull my code up at the moment. But did you change the selectionIndexes in AccordionView.m?

If you post some of your code I can try to take a look at it, otherwise, when I get back to the office I'll try to help then.

Good Luck!