-
Notifications
You must be signed in to change notification settings - Fork 38
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
How to open by default 2 sections(Headers) when view loads? #23
Comments
first you have to allow multiple selections:
and then you can set
|
Hi @suda Thanks for the reply, I have set [accordion setAllowsMultipleSelection:YES]; in my ViewController.m But Where I should call [accordion setSelectionIndexes:indexesToOpen]; code, I am not sure. Could you explain more. Please bear with me. Thank you. |
You should call |
accordion = [[AccordionView alloc] initWithFrame:CGRectMake(10, 60, 300, [[UIScreen mainScreen] bounds].size.height-30)];
[accordion setSelectionIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)]]; If I did any mistake please let me know. still it's not working for me. |
Hi,
This is very nice tutorial,exactly what I was looking for. But I need to open 2 sections(Headers) when view loads. Right now I am able to open one section when view loads. How can I open 2 or more sections when view loads.
When I added the below lines section one is opened with animation
if (!self.startsClosed && [selectionIndexes count] == 0) {
[self setSelectedIndex:0];
}
In the same way I tried for second section, but it's not working for me. May be I need to make changes some where else.
if (!self.startsClosed &&[selectionIndexes count] == 2) {
[self setSelectedIndex:2];
}
Please help me out. Once again thanks for your great work.
The text was updated successfully, but these errors were encountered: