EAIntroView

https://github.com/ealeksandrov/EAIntroView

 

This is highly customizable drop-in solution for introduction views. Some features (remember, most features are optional and can be turned off):

这是一个高度可定制的导航页解决方案,这是一些特性(记住,大部分特性都是可选的,以及可以关闭的):

  • beautiful demo project to look on some examples 一个漂亮的demo演示了好多例子

    • customizability is unlimited, one can make complex introView with animations and interactive pages, so do not limit yourself with existing examples
    • 定制是完全没有限制的.发挥你的想象力,不要局限于提供的几个例子
  • for each basic page: 对于每一个基本的页面
    • background (with cross-dissolve transition between pages) 背景
    • custom iOS7 motion effects (parallax) on background iOS7的视差效果
    • title view (+ Y position) 标题view
    • title text (+ font, color and Y position) 标题文本
    • description text (+ font, color, width and Y position) 描述文本
    • subviews array (added to page after building default layout) 子类view构成的数组
  • possibility to set your own custom view for page: 你也可以设计自定义view
    • pageWithCustomView:
    • pageWithCustomViewFromNibNamed:
  • possibility to set block action on page events: 你也可以设定每页的事件触发
    • pageDidLoad
    • pageDidAppear
    • pageDidDisappear
  • many options to customize parent view: 你还可以设定父视图
    • swipe from last page to close
    • switching pages with one simple tap
    • custom background image or color
    • custom page control
    • custom skip button
    • pinned titleView (+ Y position, can be hidden on some pages)
  • delegate protocol to listen: 监听代理
    • introDidFinish:
    • intro:pageAppeared:withIndex:
  • actions on IntroView: IntroView上面的行为设定
    • setPages:
    • showInView:animateDuration:
    • hideWithFadeOutDuration:
    • setCurrentPageIndex:animated:
  • storyboard/IB support

CocoaPods

CocoaPods is the recommended way to use EAIntroView in your project. 你可以用 CocoaPods 来安装

  • Simply add this line to your Podfilepod 'EAIntroView', '~> 2.7.0' 将pod 'EAIntroView', '~> 2.7.0'添加到你的Podfile中
  • Run pod install. 运行 pod install
  • Include with #import "EAIntroView.h" to use it wherever you need. 导入头文件#import "EAIntroView.h"
  • Subscribe to the EAIntroDelegate to enable delegate/callback interaction. 实现代理方法即可

Manual installation

  • Add EAIntroPage and EAIntroView headers and implementations to your project (4 files total). 将 EAIntroPage.h/m 与 EAIntroView.h/m 添加到你的项目当中.
  • Add EARestrictedScrollView header and implementation to your project (2 files total). 将  EARestrictedScrollView  添加到你的项目当中.
  • Include with #import "EAIntroView.h" to use it wherever you need. 导入头文件#import "EAIntroView.h"
  • Subscribe to the EAIntroDelegate to enable delegate/callback interaction. 实现代理方法即可

How To Use It

Sample project have many examples of customization. Here are only simple ones.

项目中已经包含了好多例子,这里简单的列举一例:

Step 1 - Build Pages

Each page created with [EAIntroPage page] class method. Then you can customize any property, all of them are optional. Another approach is to pass your own (can be nib), custom view in EAIntroPage, this way most other options are ignored.

每一页都是由方法 [EAIntroPage page] 生成.然后,你可以自定义这些属性.当然,你也可以用你自己的方式创建出自定义的EAIntroPage,不过,这种方式的话,好多设置都被忽略了.

// basic
EAIntroPage *page1 = [EAIntroPage page];
page1.title = @"Hello world";
page1.desc = sampleDescription1;
// custom
EAIntroPage *page2 = [EAIntroPage page];
page2.title = @"This is page 2";
page2.titleFont = [UIFont fontWithName:@"Georgia-BoldItalic" size:20];
page2.titlePositionY = 220;
page2.desc = sampleDescription2;
page2.descFont = [UIFont fontWithName:@"Georgia-Italic" size:18];
page2.descPositionY = 200;
page2.titleIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"title2"]];
page2.titleIconPositionY = 100;
// custom view from nib
EAIntroPage *page3 = [EAIntroPage pageWithCustomViewFromNibNamed:@"IntroPage"];
page3.bgImage = [UIImage imageNamed:@"bg2"];

Step 2 - Create Introduction View

Once all pages have been created, you are ready to create the introduction view. Just pass them in right order in the introduction view. You can also pass array of pages after IntroView's initialization, it will rebuild its contents.

一旦所有页码都创建出来了,你就可以创建出介绍页了.你只要按照顺序传入参数即可.

EAIntroView *intro = [[EAIntroView alloc] initWithFrame:self.view.bounds andPages:@[page1,page2,page3,page4]];

Don't forget to set the delegate if you want to use any callbacks.

不要忘记设置代理.

[intro setDelegate:self];

Step 3 - Show Introduction View

[intro showInView:self.view animateDuration:0.0];

Storyboard/IB

Since 1.3.0 EAIntroView supports init from IB. Since 2.0.0 EAIntroPage supports it too.

1.3.0版本的EAIntroView支持从IB创建.2.0.0版本的EAIntroPage也支持从IB创建.

  1. Drop UIView to your IB document. 设置一个IB的UIView
  2. Set its class to EAIntroView. 将其类别设置成EAIntroView
  3. Create IBOutlet property in your view controller: @property(nonatomic,weak) IBOutlet EAIntroView *introView;. 从你的控制器创建出属性@property(nonatomic,weak) IBOutlet EAIntroView *introView;
  4. Connect IBOutlet with EAIntroView in IB. 通过IB连接EAIntroView
  5. Build array of pages (you can use pageWithCustomViewFromNibNamed: here with separate nibs for each page). 然后,你就可以创建每一页了
  6. Pass pages array to EAIntroView property in setPages:. 将page数组的值赋给EAIntroView的setPages属性

Author

Created and maintained by Evgeny Aleksandrov (@EAleksandrov).

License

EAIntroView is available under the MIT license. See the LICENSE file for more info.

[翻译] EAIntroView的更多相关文章

  1. Xamarin.iOS - 利用Settings插件与EAIntroView制作App的欢迎界面

    Xamarin.iOS - 利用Settings插件与EAIntroView制作App的欢迎界面 关于欢迎界面 很多App第一次启动都会有一个欢迎界面,欢迎界面往往决定这用户对App的第一映像,所以欢 ...

  2. 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...

  3. 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...

  4. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  5. 【探索】机器指令翻译成 JavaScript

    前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...

  6. 《Django By Example》第三章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:第三章滚烫出炉,大家请不要吐槽文中 ...

  7. 《Django By Example》第二章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:翻译完第一章后,发现翻译第二章的速 ...

  8. 《Django By Example》第一章 中文 翻译 (个人学习,渣翻)

    书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:本人目前在杭州某家互联网公司工作, ...

  9. 【翻译】Awesome R资源大全中文版来了,全球最火的R工具包一网打尽,超过300+工具,还在等什么?

    0.前言 虽然很早就知道R被微软收购,也很早知道R在统计分析处理方面很强大,开始一直没有行动过...直到 直到12月初在微软技术大会,看到我软的工程师演示R的使用,我就震惊了,然后最近在网上到处了解和 ...

随机推荐

  1. windows下mysql配置,my.ini配置文件

    基本配置,这个配置可以直接复制到mysql根目录下了my.ini文件中, [client] port=3306 [mysql] no-beep # default-character-set= [my ...

  2. MySQL Optimization 优化原理

    MySQL Optimization 优化原理 MySQL逻辑架构 如果能在头脑中构建一幅MySQL各组件之间如何协同工作的架构图,有助于深入理解MySQL服务器.下图展示了MySQL的逻辑架构图. ...

  3. @RestController和@Controller注解的区别

    @RestController是@ResponseBody和@Controller注解的结合,当你return一个页面时,使用@Controller注解返回的是相应页面,使用@RestControll ...

  4. Maven可以提交到官方公共仓库maven.org

    参考http://central.sonatype.org/pages/ossrh-guide.html这个网址的操作,即可提交到maven.org. 这里有具体的实践方法:http://blog.c ...

  5. Python jieba库的使用说明

    1.jieba库基本介绍 (1).jieba库概述 jieba是优秀的中文分词第三方库 - 中文文本需要通过分词获得单个的词语         - jieba是优秀的中文分词第三方库,需要额外安装 - ...

  6. 使用gitlab, jenkins搭建CI(持续集成)系统(2) -- 配置webhook触发构建

    1. 在gitlab上配置192.168.1.30的ssh秘钥,使jenkins可以操作gitlab上的project 进入gitlab,点击右上角 点击 Settings -> SSH key ...

  7. input属性type为file打开文件资源管理器时,如何限制多次选取或只能一次选取的行为

    1.input标签没有设置multiple属性,文件资源管理器默认一次选取 <!doctype html> <html lang="en"> <hea ...

  8. 高云的jQuery源码分析笔记

    (function( window, undefined ) { // 构造jQuery对象 var jQuery = function( selector, context ) { return n ...

  9. Head First Python学习笔记3——持久存储

    经过上几章的学习,完成如下任务:读取一个文本文件里的内容,将每一行的内容按“:”分割成两部分,根据分割出第一项判断并分别放入两个列表里,去除首尾空白,在屏幕上打印. # 两个列表用于存储数据man=[ ...

  10. Java程序中的死锁

    什么是死锁? 死锁是一种特定的程序状态,主要是由于循环依赖导致彼此一直处于等待中,而使得程序陷入僵局,相当尴尬.死锁不仅仅发生在线程之间,而对于资源独占的进程之间同样可能出现死锁.通常来说,我们所说的 ...