当前位置:首页 > 操作系统 > Ios

iOS-一个弹出菜单动画视图开源项目分享

类似于Tumblr发布按钮的弹出视图
使用很简单:

初始化:

            
                @property (nonatomic, strong) XWMenuPopView *myMenuPopView;

- (void)viewDidLoad {
    [super viewDidLoad];
 //将弹出菜单视图添加到主视图
    _myMenuPopView = [[XWMenuPopView alloc] initWithFrame:self.view.frame];
    [_myMenuPopView setMenuPopDelegate:self];
    [self.view addSubview:_myMenuPopView];
  }

        

使用:

            
                #pragma mark - 弹出菜单监听方法
-(void)ShowMenuPopView:(UIButton *)menuPopBtn {
    [_myMenuPopView showMenu];
}
        

代理

            
                #pragma mark - MenuPopDelegate 代理方法
-(void)XWMenuPopView:(XWMenuPopView *)MenuPopView didSelectedMenuIndex:(NSInteger)selectedIndex{
    NSLog(@"->>didSelectedMenuIndex->>点击的是第%ld个按钮",selectedIndex);
}
        

备注两点:
/* 如果弹出视图不是在最前端显示,可以 /
// [self.view bringSubviewToFront:_myMenuPopView];
//如果弹出视图是在自定义UITabBarController封装的控制器,需要将 XWMenuPopView 添加在UITabBarController 子视图中

源文件下载:
https://github.com/qxuewei/XWMenuPopView

原文:http://blog.csdn.net/qxuewei/article/details/51017696


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!