Skip to content

kokomo/NGVaryingGridView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<img src="http://office.nousguide.com/nouslogosmall.png" alt="NOUSguide Inc." title="NOUSguide Inc." title" style="display:block; margin: 10px auto 30px auto;" class="center">

NGVaryingGridView

A GridView which allows to set individual Rects for the Cells. So you can define Cells with different Sizes, used e.g. in Timetables, EPGs, etc.

Sticky Views are also supported on top of the GridView and on the left side.

<img src="http://office.nousguide.com/github/NGVaryingGridView.png" alt="NGVaryingGridView" title="NGVaryingGridView" title" style="display:block; margin:20px;" class="center">

Usage

self.gridView = [[NGVaryingGridView alloc] initWithFrame:self.view.bounds];
self.gridView.gridViewDelegate = self;
[self.view addSubview:self.gridView];

[self.gridView reloadData];

The following Delegate-Methods are required:

// You should return an Array which contains CGRects for every Cell you want to display inside the GridView
- (NSArray *)rectsForCellsInGridView:(NGVaryingGridView *)gridView {
	NSMutableArray *rectsArray = [NSMutableArray array];
	[array addObject:[NSValue valueWithCGRect:CGrectMake(...)]]
	
	// ...
	
	return rectsArray;
}

// return an UIView representing your Cell
- (UIView *)gridView:(NGVaryingGridView *)gridView viewForCellWithRect:(CGRect)rect index:(NSUInteger)index {
	YourUIViewSubclass *gridCell = (YourUIViewSubclass *)[gridView dequeueReusableCell] ? : [[YourUIViewSubclass alloc] initWithFrame:rect];
	gridCell.frame = rect;
	
	// setup gridCell
	
	return gridCell
}

Just have a look inside the provided Demo-Application.

Credits

NGVaryingGridView was created by Philip Messlehner

License

NGPageControl is available under the MIT license. See the LICENSE file for more info. For usage without attribution contact NOUSguide.

About

A GridView which allows to set individual Rects for the Cells. So you can define Cells with different Sizes, used for e.g. in Timetables, EPGs, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published