##FCPopMenu 简易、友好的下拉菜单
An easy,friendly and customizable way to make a popover menu.
###Installation
Cocoapods
pod “FCPopMenu”, “~>1.0”
Use pod repo update
if not exist.
Manual
Download FCPopMenu
,drag folder “FCPopMenu” into your project, make sure to ues “create group if need”.
###Useage
How to create FCPopMenuItems
1 | NSArray *names=@[@"新建剧情",@"发布招募",@"搜一搜"]; |
FCPopMenu
Create a popover menu like this
1 | _list=[FCPopMenu menuWithFrame:CGRectMake(kFCPopMenuWidth-143, 64, 138, 140) trangleHeight:10 tranglePosition:CGPointMake(112, 0) items:items]; |
You may need a overlay view1
2
3
4
5
6
7
8
9
10-(UIControl *)back{
if(!_back){
_back=[[UIControl alloc] initWithFrame:self.view.bounds];
_back.backgroundColor=[UIColor clearColor];
[_back addTarget:self action:@selector(hideList:) forControlEvents:UIControlEventTouchUpInside];
}
return _back;
}
Troggle show/close menu
1 | -(void)addBtnClickAction:(UIBarButtonItem *)sender{ |
Monitor click action
1 | -(void)listClickAction:(FCPopMenuItem *)sender{ |
Hide1
2
3
4
5-(void)hideList:(UIControl *)sender{
[sender removeFromSuperview];
[self.list removeFromSuperview];
}
Source code on github click-> here
About Me
- Blog: CGPointZeero
- GitHub: Insfgg99x
- Mooc: CGPointZero
- Jianshu: CGPointZero
- Email: newbox0512@yahoo.com
@CGPoitZero