Skip to content

zsmzhu/MinScrollMenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MinScrollMenu

A custom horizontal scroll menu

Installation

CocoaPods

pod ‘MinScrollMenu’

How to use

Storyboard or xib setup

  1. create a MinScrollMenu on storyboard.
  2. drag the IBOutlet of MinScrollMenu to you controller.
  3. set the delegate property to the controller, like this: _menu.delegate = self;

Manual setup

_menu = [[MinScrollMenu alloc] initWithFrame:CGRectMake(0, 0, 320, 100)];
_menu.delegate = self;
[self.view addSubview:_menu];

Note

  1. Require to realization 3 protocol methods:
	- (NSInteger)numberOfMenuCount:(MinScrollMenu *)menu;
	- (CGFloat)scrollMenu:(MinScrollMenu *)menu widthForItemAtIndex:(NSInteger)index;
	- (MinScrollMenuItem *)scrollMenu:(MinScrollMenu *)menu itemAtIndex:(NSInteger)index;
  1. Xib or storyboard create MinScrollMenuItem is not supported

  2. If the menu content size is not correct. Add this code for your controller:

    self.automaticallyAdjustsScrollViewInsets = NO;

Here you go

About

a custom horizontal scroll menu

Resources

License

Stars

Watchers

Forks

Packages

No packages published