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;

最新文章

  1. 页面元素坐标和偏移(clientX/pageX/screenX/layerX/offsetWidth/scrollWidth/clientWidth等)相关整理
  2. ASP.NET vNext 概述
  3. kill 根据PID终止进程
  4. windows系统常用快捷键及其作用
  5. python多线程下载
  6. OGG-00782 - OGG 11.2.1.0.2 FOR Windows x64 Microsoft SQL Server
  7. Codeforces Round #209 (Div. 2)
  8. C# string LastIndexOf()
  9. MYSQL定时创建表分区
  10. 802.11(wi-fi)的PHY层(编码与调制方法)
  11. HTML <td> 标签的 rowspan 属性
  12. 逆向与Bof基础
  13. 从分布式一致性到共识机制(一)Paxos算法
  14. Android Studio Gradle Configuration Errors总结
  15. Cocos2d-js和Android交互
  16. gps 经纬度 转换实际距离
  17. js或jQuery获取当前屏幕的各种高度
  18. Docker国内镜像source
  19. CPP全面总结(涵盖C++11标准)
  20. 一份针对nginx的内核优化参数

热门文章

  1. tomcat启动(一)startup.bat|catalina.bat分析
  2. centos 关闭selinux 临时关闭selinux 报错 setenforce: setenforce() failed
  3. docker 创建elasticsearch集群镜像
  4. spring AOP 之四:@AspectJ切入点标识符语法详解
  5. 【LeetCode题解】141_环形链表
  6. SpringMVC 之 Hello World 入门
  7. [有料组每日学习分享计划--00087]32行代码帮你导出IOS酷我音乐下载的无损音乐
  8. 记录一次读取memcache缓存的优化
  9. Node.js Express 框架2
  10. C#/Net代码精简优化技巧