GCDiscreetNotificationView

GCDiscreetNotificationView is a discreet, non-modal, notification view for iOS. You can use it to show an activity or state of you app without blocking the user interactions.

GCDiscreetNotificationView是一个设计精细,通知类型的view,你可以用来标示一种状态,而不会阻塞用户交互。

GCDiscreetNotificationView features:

GCDiscreetNotificationView的特性:

  • Easy to use : init and show 使用很简单,初始化,然后显示
  • Can show an activity indicator 可以显示动态状态更新
  • Two presentation mode (top and bottom) 两种展示方式(顶部和底部)
  • All properties (text, activity and presentation mode) can be changed in a animated fashion 所有属性(文本,指示器以及显示方式)都可以动态改变

Usage

(See the demo project included)

(请先看一下demo)

You simply allocate the notification view with one of the following methods.

你可以使用下面的任何一种初始化方法来显示通知的view。

The parameters are the following :

下面的参数:

  • text : the text presented on the notification 通知展示用的文本
  • activity : if set to YES, the notification with show a activity indicator 如果设置成YES,则会显示出指示器
  • aPresentationMode : the presentation mode of the notification (top or bottom) 设置展示通知的方式
  • aView : the view that will contain the notification. The view should be able to accept subviews (will not work on a UITableView for example) 可以接受通知view的容器view,这个view能够接受并合理的显示出subviews(这个不会在TableView上面显示哦)
- (id) initWithText:(NSString *)text inView:(UIView *)aView;
- (id) initWithText:(NSString *)text showActivity:(BOOL)activity inView:(UIView *)aView;
- (id) initWithText:(NSString *)text showActivity:(BOOL)activity inPresentationMode:(GCDiscreetNotificationViewPresentationMode) aPresentationMode inView:(UIView *)aView;

You show or hide the notification with these methods. The showAndDismissAutomaticallyAnimated will hide your notification automatically after 1 second.

你可以用下面的方法来隐藏或者显示这些方法。showAndDismissAutomaticallyAnimated 会在1s后自动隐藏你的通知view。

- (void) showAnimated;
- (void) hideAnimated;
- (void) hideAnimatedAfter:(NSTimeInterval) timeInterval;
- (void) show:(BOOL) animated;
- (void) hide:(BOOL) animated;
- (void) showAndDismissAutomaticallyAnimated;
- (void) showAndDismissAfter:(NSTimeInterval) timeInterval;

You can change the text of the label of the activity viewing at any moment with these properties.

你可以在任意时刻修改label上的文本。

@property (nonatomic, assign) UIView *view;
@property (nonatomic, assign) GCDiscreetNotificationViewPresentationMode presentationMode;
@property (nonatomic, copy) NSString* textLabel;
@property (nonatomic, assign) BOOL showActivity;

These properties can be changed in a animated fashion (except the view).

下面这些属性可以动态修改(修改的时候会有动画)。

- (void) setTextLabel:(NSString *) aText animated:(BOOL) animated;
- (void) setShowActivity:(BOOL) activity animated:(BOOL) animated;
- (void) setTextLabel:(NSString *)aText andSetShowActivity:(BOOL)activity animated:(BOOL)animated;
- (void) setPresentationMode:(GCDiscreetNotificationViewPresentationMode) newPresentationMode animated:(BOOL) animated;

You can access directly the notification’s label and activity indicator. And change some propreties on that label and activity indicator. If you want to change the label’s text or hide the indicator, use textLabel or showActivity instead.

你也可以直接的操作通知上面的label以及状态指示器。也可以直接修改这些属性上面的文本以及指示器,如果你想要修改label上面的文本,或者是隐藏指示器,使用textLabel或者是showActivity来代替。

@property (nonatomic, retain, readonly) UILabel *label;
@property (nonatomic, retain, readonly) UIActivityIndicatorView *activityIndicator;

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

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

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

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

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

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

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

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

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

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

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

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

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

  9. ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点

    在这一章中,我们将学习如何使用基架快速搭建和运行一个简单的Microsoft ASP.NET MVC Web站点.在我们马上投入学习和编码之前,我们首先了解一些有关ASP.NET MVC和Entity ...

随机推荐

  1. 修改salt-minion的id后报错解决方法

    centos7使用命令 /usr/bin/salt-minion start运行报错 Error parsing configuration file: /etc/salt/master - expe ...

  2. java.text包

    JDK在java.text包中,提供了对显示对象格式化的接口.类及异常处理,这里我们只来谈一谈text包中的format类及其子类.其中,最重要的是两个差不多互为“逆运算”的方法format(将某对象 ...

  3. 常用工具说明--mysql数据库安装

    MySQL安装文件分为两种,一种是msi格式的,一种是zip格式的.如果是msi格式的可以直接点击安装,按照它给出的安装提示进行安装(相信大家的英文可以看懂英文提示),一般MySQL将会安装在C:\P ...

  4. vue-webpack 做出来的项目部署到服务器上,点开是空白页(我这里把项目发布到git上)

    总结1: 从网上下的很多demo,用npm run dev 就可以启动项目,比如:vue-cli,为什么?因为vue-cli自动帮我们安装了express服务器. 总结2: npm run dev 是 ...

  5. sql 数据库数据 批量判断修改

    A表B表相关联  更新B表中的VisitWeek字段值 CCD_PartnerVisit 此为B表 Dell_FiscalWeek  此为A表 UPDATE CCD_PartnerVisit SET ...

  6. centos7 离线安装Ambari

    准备工作: 新下载的centos7 安装 createrepo,用于制作源 yum install createrepo 安装java (推荐 java 1.7以上版本,如果有,则跳过此步骤) yum ...

  7. Java基础教程(22)--异常

    一.什么是异常   异常就是发生在程序的执行期间,破坏程序指令的正常流程的事件.当方法中出现错误时,该方法会创建一个对象并将其交给运行时系统.该对象称为异常对象,它包含有关错误的信息,包括错误的类型和 ...

  8. 第三节:我的第一个Java程序

    一.编写我的第一个Java程序流程: 1.新建一个文本文档:在电脑任意位置“右击”----->选择“新建”----->选择“文本文档”: 2.修改文档名与后缀名:“右击”新建的文本文档-- ...

  9. IDEA 现有项目连接SVN

    前言:有时会先搭建好系统,准备好所有配置文件及公共类,然后才会从IDEA中将代码放到SVN中,这里正好讲述了如何从现有代码连接到SVN. 首先将该项目启动SVN管理 然后关联对应SVN地址 右键项目名 ...

  10. ubuntn安装

    环境win7 64 ,在vmn中安装ubuntn,需要开启虚拟化操作步骤: 1.首先进入BIOS,我的是thinkphpE440,在开机联想界面出现的那刻按F1: 2.选择切换到security页面, ...