拥有漂亮的动画iOS下拉菜单:IGLDropDownMenu
jopen
10年前
IGLDropDownMenu是一个iOS下拉菜单。可以实现多种菜单动画效果。旋转、难叠、滑动等。
示例代码
-
Create your
IGLDropDownItem
array and set upNSMutableArray *dropdownItems = [[NSMutableArray alloc] init]; IGLDropDownItem *item = [[IGLDropDownItem alloc] init]; [item setIconImage:[UIImage imageNamed:@"icon.png"]]; [item setText:@"title"]; [dropdownItems addObject:item];
-
Create your
IGLDropDownMenu
and set the up the parameter namedropDownItems
IGLDropDownMenu *dropDownMenu = [[IGLDropDownMenu alloc] init]; [dropDownMenu setFrame:CGRectMake(0, 0, 200, 45)]; dropDownMenu.menuText = @"Choose Weather"; dropDownMenu.menuIconImage = [UIImage imageNamed:@"chooserIcon.png"]]; dropDownMenu.paddingLeft = 15; // padding left for the content of the button
-
modify the params of
IGLDropDownMenu
dropDownMenu.type = IGLDropDownMenuTypeStack; dropDownMenu.gutterY = 5; dropDownMenu.itemAnimationDelay = 0.1; dropDownMenu.rotate = IGLDropDownMenuRotateRandom;
-
Call the
reloadView
method (Very Important!)// every time you change the params you should call reloadView method [dropDownMenu reloadView];