[翻译] IGLDropDownMenu
IGLDropDownMenu
An iOS drop down menu with pretty animation.
一种iOS点击下拉菜单样式,动画效果很绚丽。
Screenshot - 截图
How To Use - 如何使用
!Try the demo. It's really helpful! 试试demo,看看效果哦!
Sample Code - 示例源码
Create your
IGLDropDownItem
array and set up 创建IGLDropDownItem数组然后进行设置NSMutableArray *dropdownItems = [[NSMutableArray alloc] init];
IGLDropDownItem *item = [[IGLDropDownItem alloc] init];
[item setIconImage:[UIImage imageNamed:@"icon.png"]];
[item setText:@"title"];
[dropdownItems addObject:item];Create your
IGLDropDownMenu
and set the up the parameter namedropDownItems 创建你的IGLDropDownMenu,设置dropDownItems的名字
IGLDropDownMenu *dropDownMenu = [[IGLDropDownMenu alloc] init];
[dropDownMenu setFrame:CGRectMake(0, 0, 200, 45)];
dropDownMenu.menuText = @"Choose Weather";
dropDownMenu.menuIconImage = [UIImage imageNamed:@"chooserIcon.png"]];
dropDownMenu.paddingLeft = 15; // padding left for the content of the buttonmodify the params of
IGLDropDownMenu 修改IGLDropDownMenu的参数
dropDownMenu.type = IGLDropDownMenuTypeStack;
dropDownMenu.gutterY = 5;
dropDownMenu.itemAnimationDelay = 0.1;
dropDownMenu.rotate = IGLDropDownMenuRotateRandom;Call the
reloadView
method (Very Important!) 执行reloadView(非常重要!)// every time you change the params you should call reloadView method
[dropDownMenu reloadView];
Parameters - 参数
These are just some of the parameters you can use, you can find more(or make more) in the code.
你可以使用很多很多的参数,详情请参考源码吧。
For IGLDropDownMenu
animationDuration
set the duration(s) of the animation in second 设置动画时间animationOption
set the UIViewAnimationOptions for the animation 设置动画样式itemAnimationDelay
set the delay(s) before each of item start to animate 设置每个item的延时动画时间direction
set the direction when the menu expand 设置菜单展开的方向IGLDropDownMenuDirectionDown
default value, expand downwardIGLDropDownMenuDirectionUp
expand upward
rotate
set the rotate style when the menu on expand 设置菜单展开时候的旋转风格IGLDropDownMenuRotateNone
default value, for no rotateIGLDropDownMenuRotateLeft
rotate to left on expandIGLDropDownMenuRotateRight
rotate to right on expandIGLDropDownMenuRotateRandom
rotate random on expand every single time
type
set the menu type (remember when you set the type to SlidingIn* you can't have the rotate type at the same time.) 设置菜单样式IGLDropDownMenuTypeNormal
default value, item will hide behind the menu button on foldIGLDropDownMenuTypeStack
item will hide behind the menu button and make a stack like lookIGLDropDownMenuTypeSlidingInBoth
item will slide in and out from both sidesIGLDropDownMenuTypeSlidingInFromLeft
item will slide in from leftIGLDropDownMenuTypeSlidingInFromRight
item will slide in from right
slidingInOffset
set the offset value for the items slide in and out 设置item滑进来时候的偏移量gutterY
set the Y gutter between items 设置item之间的间隔alphaOnFold
set the item alpha value when menu on fold, only use this when the style won't fit your mind 菜单层叠时候的透明度flipWhenToggleView
when you set this to true, the menu button will flip up when you click 当你设置这个值为true,这个按钮会向上翻useSpringAnimation
use the spring animation for iOS7 or higher version, default is true 使用spring动画效果,默认开启
For IGLDropDownItem
iconImage
set the icon image for the item 设置item的图片text
set the text string for the item 设置texttextLabel
for you to adjust the text label style 方便你设置调整Label样式object
you can store your custom item in this preporty 你可以用它来存储你的自定义item
Remember the menuButton
in IGLDropDownMenu
is also an IGLDropDownItem
.
请记住,在IGLDropDownMenu中,menuButton也是IGLDropDownItem。
Requirements - 需要
- target platform: >=iOS 6.0 (I never test the version below 6.0, maybe you can make some try and tell me.) >iOS6.0
- ARC ARC
TODO - 以后要做的事情
- make
IGLDropDownItem
more customizable 让IGLDropDownItem可定制程度更高 add the spring animation for iOS 7 or higher version- add more animation effect for the menu 更多的动画效果
- just contact me and tell me more 联系我,给我建议帮我改进
Thanks - 感谢
This drop-down menu idea is come from here, I found this demo one day and just implement it on iOS.
这个菜单的主意来自于 here,我发现了这个demo后,然后在iOS上实现了。
[翻译] IGLDropDownMenu的更多相关文章
- 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...
- 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...
- [翻译]开发文档:android Bitmap的高效使用
内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...
- 【探索】机器指令翻译成 JavaScript
前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...
- 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...
- 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...
- 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...
- 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?
0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点
在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...
随机推荐
- 【文档】三、Mysql Binlog事件类文件和类型
在内部,服务器使用C++类文件来表示binlog事件.标准在log_event.h文件中,这些类的方法代码在log_event.cc中. log_event是基础类.其他的详细的事件子类都是来源于他. ...
- springboot-22-自定义starter
先说下springboot的运行原理 springboot最主要的配置 是 @SpringBootApplication 然后这里面 @EnableAutoCOnfiguration 最为重要, 继续 ...
- bug:执行到数据库连接后停止运行,而且不报错的奇怪情况----可能是多方同时访问造成的
数据库运行过程中奇怪停止. 即执行到“database connected ”停止运行,而且不产生任何报错信息 程序反复检查没有问题,折腾半天解决了: 可能是多个客户端操作同一个表格,多方同时操作造成 ...
- Idea软件Vim插件问题
人家说用webstorm是纯前端,用Idea是java+前端,好,那就用Idea,装上试试,全选所有插件安装,奇迹出现了,选中一行代码,backspace,删不了,我的天,好吧,复制粘贴的快捷键也不行 ...
- CSS3 Media Queries_media queries, css3属性详解
Media Queries直译过来就是"媒体查询",在我们平时的Web页面中head部分常看到这样的一段代码: <link href="css/reset.css& ...
- 用INFORMATION_SCHEMA逻辑MySQL的索引
分库分表的场景下,变更目前还不知道有哪个表变更索引失败,是不是所有的表都变更成功了,所以可以从INFORMATION_SCHEMA通过罗列索引个数,或者查看索引行,就可以知道是不是所有的都变更成功了: ...
- C#可选参数、命名参数、参数数组
学习了C#4.0的新特性:可选参数.命名参数.参数数组. 1.可选参数,是指给方法的特定参数指定默认值,在调用方法时可以省略掉这些参数. 但要注意: (1)可选参数不能为参数列表的第1个参数,必须位于 ...
- nodejs的gridfs基本操作
var mongoose = require('mongoose'); var Schema = mongoose.Schema; mongoose.connect('mongodb://127.0. ...
- Java Calendar Date使用总结
Java Calendar Date使用总结 package cn.outofmemory.codes.Date; import java.util.Calendar; import java.uti ...
- JS 浮点数计算
一.从String中解析浮点数 parseFloat(string) 语法说明 parseFloat是个全局函数,不属于任何对象. parseFloat将它的字符串参数解析成为浮点数并返回.如果在解析 ...