漂亮的菜单动画

移动开发
可以为app的菜单添加漂亮的动画内容,可以自定义icon和title,可根据自己喜好设计单元格和布局。

源码简介

可以为app的菜单添加漂亮的动画内容,可以自定义icon和title,可根据自己喜好设计单元格和布局。
源码运行截图

源码片段:

  1. - (IBAction)presentMenuButtonTapped:(UIBarButtonItem *)sender { 
  2.     // init YALContextMenuTableView tableView 
  3.     if (!self.contextMenuTableView) { 
  4.         self.contextMenuTableView = [[YALContextMenuTableView alloc]initWithTableViewDelegateDataSource:self]; 
  5.         self.contextMenuTableView.animationDuration = 0.15
  6.         //optional - implement custom YALContextMenuTableView custom protocol 
  7.         self.contextMenuTableView.yalDelegate = self; 
  8.           
  9.         //register nib 
  10.         UINib *cellNib = [UINib nibWithNibName:@"ContextMenuCell" bundle:nil]; 
  11.         [self.contextMenuTableView registerNib:cellNib forCellReuseIdentifier:menuCellIdentifier]; 
  12.     } 
  13.   
  14.     // it is better to use this method only for proper animation 
  15.     [self.contextMenuTableView showInView:self.navigationController.view withEdgeInsets:UIEdgeInsetsZero animated:YES]; 
  16.   
  17. #pragma mark - Local methods 
  18.   
  19. - (void)initiateMenuOptions { 
  20.     self.menuTitles = @[@""
  21.                         @"Send message"
  22.                         @"Like profile"
  23.                         @"Add to friends"
  24.                         @"Add to favourites"
  25.                         @"Block user"]; 
  26.   
  27.     self.menuIcons = @[[UIImage imageNamed:@"Icnclose"], 
  28.                        [UIImage imageNamed:@"SendMessageIcn"], 
  29.                        [UIImage imageNamed:@"LikeIcn"], 
  30.                        [UIImage imageNamed:@"AddToFriendsIcn"], 
  31.                        [UIImage imageNamed:@"AddToFavouritesIcn"], 
  32.                        [UIImage imageNamed:@"BlockUserIcn"]]; 

源码下载:http://down.51cto.com/data/1984622

责任编辑:chenqingxiang 来源: 网络整理
相关推荐

2012-09-13 09:24:31

CSSJSjQ

2022-10-30 21:11:10

ManimPython动画

2014-04-29 10:39:27

CSS3JavaScript

2022-03-29 09:33:34

LinuxShell命令

2011-05-26 09:39:53

程序

2020-09-17 16:00:03

Python 开发编程语言

2017-04-06 22:33:43

with磁盘数据

2021-06-10 10:26:03

PythonGUI软件包

2017-08-17 12:03:58

前端CSS加载

2013-11-21 11:33:12

openSUSE 13LinuxopenSUSE

2016-11-25 13:50:15

React组件SFC

2020-07-10 15:41:41

Python代码编程语言

2018-11-06 12:22:18

排序算法代码

2023-05-15 20:08:04

Linux字体

2019-09-17 14:31:52

JSJavaScript前端

2020-06-30 09:38:14

Linux发行版操作系统

2020-02-25 21:13:06

Windows 7Windows 10Windows 10X

2015-08-03 11:42:27

Swift汉堡式过度动画

2021-07-21 05:31:39

Windows 11操作系统微软

2010-10-28 11:25:34

应聘
点赞
收藏

51CTO技术栈公众号