代码库> 菜单> HyPopMenuView模仿新浪微博弹出菜单
HyPopMenuView模仿新浪微博弹出菜单
关注
上传者:wwdc14 分类:菜单(Menu)
查看次数:5950 下载次数:23
上传时间:2015-09-10 大小:
*  Manually Import【手动导入】

【将HyPopMenuView,UIColor+ImageGetColor,MenuLabel所有源代码拽入项目中】 【导入主头文件:#import "HyPopMenuView.h"】

HyPopMenuView.h         HyPopMenuView.m
UIColor+ImageGetColor.h UIColor+ImageGetColor.m
MenuLabel.h             MenuLabel.m
Example【示例】

NSArray *Objs = @[
                      [MenuLabel CreatelabelIconName:@"tabbar_compose_idea" Title:@"文字"],
                      [MenuLabel CreatelabelIconName:@"tabbar_compose_photo" Title:@"相册"],
                      [MenuLabel CreatelabelIconName:@"tabbar_compose_camera" Title:@"拍摄"],
                      [MenuLabel CreatelabelIconName:@"tabbar_compose_lbs" Title:@"签到"],
                      [MenuLabel CreatelabelIconName:@"tabbar_compose_review" Title:@"点评"],
                      [MenuLabel CreatelabelIconName:@"tabbar_compose_more" Title:@"更多"],
                      ];
    CGFloat x,y,w,h;
    x = CGRectGetWidth(self.view.bounds)/2 - 213/2;
    y = CGRectGetHeight([UIScreen mainScreen].bounds)/2 * 0.3f;
    w = 213;
    h = 57;
    //自定义的头部视图
    UIImageView *topView = [[ImageView alloc] initWithFrame:CGRectMake(x, y, w, h)];
    topView.image = [UIImage imageNamed:@"compose_slogan"];
    topView.contentMode = UIViewContentModeScaleAspectFit;

    NSMutableDictionary *AudioDictionary = [NSMutableDictionary dictionary];

    //添加弹出菜单音效
    [AudioDictionary setObject:@"composer_open" forKey:kHyPopMenuViewOpenAudioNameKey];
    [AudioDictionary setObject:@"wav" forKey:kHyPopMenuViewOpenAudioTypeKey];
    //添加取消菜单音效
    [AudioDictionary setObject:@"composer_close" forKey:kHyPopMenuViewCloseAudioNameKey];
    [AudioDictionary setObject:@"wav" forKey:kHyPopMenuViewCloseAudioTypeKey];
    //添加选中按钮音效
    [AudioDictionary setObject:@"composer_select" forKey:kHyPopMenuViewSelectAudioNameKey];
    [AudioDictionary setObject:@"wav" forKey:kHyPopMenuViewSelectAudioTypeKey];


    [HyPopMenuView CreatingPopMenuObjectItmes:Objs TopView:topView OpenOrCloseAudioDictionary:AudioDictionary SelectdCompletionBlock:^(MenuLabel *menuLabel, NSInteger index) {
        NSLog(@"index:%ld ItmeNmae:%@",index,menuLabel.title);
    }];

附件較大,請在此處下載::https://github.com/wwdc14/HyPopMenuView
收藏
我来说两句
发表评论
您还没有登录!请登录注册
所有评论(0


下载过该代码的还下载了
综合评论
提示
sina weixin mail 回到顶部