iOS动画菜单:DWBubbleMenuButton
jopen
10年前
DWBubbleMenuButton是一个简单的动画类,用于展开和折叠可变大小的菜单。项目允许菜单在左,右,上和下几个方向展开。使用类很简单,只要设置你的home键,加入了菜单按钮的数组。
用法
Create a home button
UIButton *menuButton = [UIButton buttonWithType:UIButtonTypeSystem]; [menuButton setTitle:@"Menu" forState:UIControlStateNormal];
Create an instance of DWBubbleMenuButton
DWBubbleMenuButton *bubbleMenuButton = [[DWBubbleMenuButton alloc] initWithFrame:CGRectMake(20.f, 20.f, 100.f, 100.f) expansionDirection:DirectionDown]; bubbleMenuButton.homeButtonView = menuButton;
Add buttons to your bubble menu
[bubbleMenuButton addButtons:@[ /* your buttons */]]; /* OR */ [bubbleMenuButton addButton:/* your button */];