Skip to content
Simple accordion view in Cocoa Touch
Objective-C
Find file
Pull request Compare This branch is 9 commits ahead, 36 commits behind appsome:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
AccordionView.h
AccordionView.m
README.md

README.md

AccordionView

Very simple accordion view in Cocoa Touch.

Usage

AccordionView *accordion = [[AccordionView alloc] initWithFrame:CGRectMake(0, 0, 320, 420)];
[self addSubview:accordion];

// Only height is taken into account, so other parameters are just dummy
UIButton *header1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 0, 30)];
[header1.titleLabel setText:@"First row"];

UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 200)];
// ... add subviews to view1

[accordion addHeader:header1 withView:view1];

// ... add more panels

[accordion setNeedsLayout];

// Set this if you want to allow multiple selection
[accordion setAllowsMultipleSelection:YES];

Todo

  • Horizontal view

LICENCE

Copyright (C) 2011 Wojtek Siudzinski admin@suda.pl, Appsome

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Something went wrong with that request. Please try again.