模仿新浪微博弹出菜单

时间:2024-04-24 16:07:36
【文件属性】:

文件名称:模仿新浪微博弹出菜单

文件大小:3.18MB

文件格式:ZIP

更新时间:2024-04-24 16:07:36

IOS源码

源码HyPopMenuView,该案例HyPopMenuView模仿新浪微博弹出菜单, 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:Audio


网友评论