项目介绍:
YANScrollMenu
Requirements
-
ARC
-
iOS 8.0+
Cocoapods
YANScrollMenu is available via Cocoapods, add this line in your podfile :
pod 'YANScrollMenu', '~> 0.9.0'
Usage
-
Import the class :
#import "YANScrollMenu.h" -
Simply initialize a
YANScrollMenuthe same way you set up a regular UIView:self.menu = [[YANScrollMenu alloc] initWithFrame:CGRectMake(0, 0, 375,150)]; [self.view addSubview:self.menu]; -
YANScrollMenuProtocolmust be adopted :- (NSUInteger)numberOfRowsForEachPageInScrollMenu:(YANScrollMenu *)scrollMenu; - (NSUInteger)numberOfItemsForEachRowInScrollMenu:(YANScrollMenu *)scrollMenu; - (NSUInteger)numberOfMenusInScrollMenu:(YANScrollMenu *)scrollMenu; - (YANMenuObject *)scrollMenu:(YANScrollMenu *)scrollMenu objectAtIndexPath:(NSIndexPath *)indexPath; -
Custom appearance :
[[YANMenuItem appearance] setIconSize:30]; [[YANMenuItem appearance] setIconCornerRadius:15]; [[YANMenuItem appearance] setTextFont:[UIFont systemFontOfSize:12]]; [[YANMenuItem appearance] setTextColor:[UIColor darkTextColor]];The function in
YANScrollMenuProtocolcan be use to adjust the edgeInsets ofYANMenuItem:- (YANEdgeInsets)edgeInsetsOfItemInScrollMenu:(YANScrollMenu *)scrollMenu;
Dependency
YANScrollMenu depend on SDWebImage and Masonry.
-
When the version of
SDWebImagelarge than3.8.2, gif will not be supported.
Release Notes
-
V 0.9.0 The first version
License
YANScrollMenu is released under the MIT license. See LICENSE file for details.
Contact
Any suggestion or question? Please create a Github issue .
Github
