功能分类:特效
支持平台:iOS
运行环境:iOS
开发语言:Object-c
开发工具:Xcode
源码大小:201.42KB
源码下载地址:http://down.51cto.com/data/1976533
源码简介
通过自定义模型实现QQ音乐的ActionSheet效果。可以自定义菜单的图片,菜单的数组和电机事件。方便使用。
源码运行截图
源码片段
- -(void)initDemoData{
- DownSheetModel *Model_1 = [[DownSheetModel alloc]init];
- Model_1.icon = @"icon_add";
- Model_1.icon_on = @"icon_add_hover";
- Model_1.title = @"添加";
- DownSheetModel *Model_2 = [[DownSheetModel alloc]init];
- Model_2.icon = @"icon_album";
- Model_2.icon_on = @"icon_album_hover";
- Model_2.title = @"专辑";
- DownSheetModel *Model_3 = [[DownSheetModel alloc]init];
- Model_3.icon = @"icon_buy";
- Model_3.icon_on = @"icon_buy_hover";
- Model_3.title = @"购买";
- DownSheetModel *Model_4 = [[DownSheetModel alloc]init];
- Model_4.icon = @"icon_computer";
- Model_4.icon_on = @"icon_computer_hover";
- Model_4.title = @"同步";
- DownSheetModel *Model_5 = [[DownSheetModel alloc]init];
- Model_5.icon = @"icon_down";
- Model_5.icon_on = @"icon_down_hover";
- Model_5.title = @"下载";
- DownSheetModel *Model_6 = [[DownSheetModel alloc]init];
- Model_6.icon = @"icon_del";
- Model_6.icon_on = @"icon_del_hover";
- Model_6.title = @"删除";
- MenuList = [[NSArray alloc]init];
- MenuList = @[Model_1,Model_2,Model_3,Model_4,Model_5,Model_6];
- }
- -(void)clickMenu{
- DownSheet *sheet = [[DownSheet alloc]initWithlist:MenuList height:0];
- sheet.delegate = self;
- [sheet showInView:nil];
- }
- -(void)didSelectIndex:(NSInteger)index{
- UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示" message:[NSString stringWithFormat:@"您当前点击的是第%d个按钮",index] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
- [alert show];
- }