[翻译] JFMinimalNotifications
JFMinimalNotifications
This is an iOS UIView for presenting a beautiful notification that is highly configurable and works for both iPhone and iPad. JFMinimalNotification is only available in ARC and targets iOS 7.0+.
这是一个iOS的view,用以呈现非常漂亮的通知信息,高度定制,可以同时用于iPhone和iPad。JFMinimalNotification只支持ARC,iOS7.0以上。
What It Looks Like: 它看起来像这样子:
See a short video of this control here: https://www.youtube.com/watch?v=jDYC-NYKl9A
你可以在这个地方观看演示视频https://www.youtube.com/watch?v=jDYC-NYKl9A
Screen Shots 截图
How To Use It: 这么用:
Basic Example
基本用法
- (void)viewDidLoad
{
[super viewDidLoad]; /**
* Create the notification
*/
self.minimalNotification = [JFMinimalNotification notificationWithStyle:JFMinimalNotificationStyleDefault
title:@"This is my awesome title"
subTitle:@"This is my awesome sub-title"]; /**
* Set the desired font for the title and sub-title labels
* Default is System Normal
*/
UIFont* titleFont = [UIFont fontWithName:@"STHeitiK-Light" size:22];
[self.minimalNotification setTitleFont:titleFont];
UIFont* subTitleFont = [UIFont fontWithName:@"STHeitiK-Light" size:16];
[self.minimalNotification setSubTitleFont:subTitleFont]; /**
* Add the notification to a view
*/
[self.view addSubview:self.minimalNotification];
} /**
* Showing the notification from a button handler
*/
- (IBAction)show:(id)sender {
[self.minimalNotification show];
} /**
* Hiding the notification from a button handler
*/
- (IBAction)dismiss:(id)sender {
[self.minimalNotification dismiss];
}
Constructors / Options
构造器 / 选项
/**
* Note: passing a dismissalDelay of 0 means the notification will NOT be automatically dismissed, you will need to
* dismiss the notification yourself by calling -dismiss on the notification object. If you pass a dismissalDelay
* value greater than 0, this will be the length of time the notification will remain visisble before being
* automatically dismissed.
*/ // With dismissalDelay
self.minimalNotification = [JFMinimalNotification notificationWithStyle:JFMinimalNotificationStyleError title:@"This is my awesome title" subTitle:@"This is my awesome sub-title" dismissalDelay:3.0]; // Without dismissalDelay and with touchHandler
self.minimalNotification = [JFMinimalNotification notificationWithStyle:JFMinimalNotificationStyleError title:@"This is my awesome title" subTitle:@"This is my awesome sub-title" dismissalDelay:0.0 touchHandler:^{
[self.minimalNotification dismiss];
}];
// Available Styles
typedef NS_ENUM(NSInteger, JFMinimalNotificationStytle) {
JFMinimalNotificationStyleDefault,
JFMinimalNotificationStyleError,
JFMinimalNotificationStyleSuccess,
JFMinimalNotificationStyleInfo,
JFMinimalNotificationStyleWarning
};
Please see the example project include in this repo for an example of how to use this notification.
你可以参考示例项目来看看怎么使用这个通知的控件。
Delegate Methods: 代理方法
- (void)willShowNotification:(JFMinimalNotification*)notification;
- (void)didShowNotification:(JFMinimalNotification*)notification;
- (void)willDisimissNotification:(JFMinimalNotification*)notification;
- (void)didDismissNotification:(JFMinimalNotification*)notification;
Installation: 安装
Cocoapods Cocoapods安装
pod 'JFMinimalNotifications', '~> 0.0.2'
Directly include source into your projects
直接将源码拖到你的项目当中即可
- Simply copy the source files from the "JFMinimalNotification" folder into your project. 你只需要简单的将JFMinimalNotification文件夹拖到你的项目当中
- In your application's project app target settings, find the "Build Phases" section and open the "Link Binary With Libraries" block and click the "+" button and select the "CoreGraphics.framework". 在你的工程项目当中,找到Build Phases区,打开Link Binary With Libraries,点击+按钮,然后选择CoreGraphics.framework框架
[翻译] JFMinimalNotifications的更多相关文章
- 《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 ...
随机推荐
- NMS—卷积神经网络
1-传统的NMS NMS,非极大值抑制,在很多计算机视觉问题中有着重要应用,尤其是目标检测领域. 以人脸检测为例,通常的流程为3步: (1)通过滑动窗口或者其它的object proposals方法产 ...
- fiddler工作原理和设置代理问题
1,什么是Fiddler Fiddler是一个http协议调试代理工具,它能够记录客户端和服务器之间的所有 HTTP请求,可以针对特定的HTTP请求,分析请求数据.设置断点.调试web应用.修改请求的 ...
- java课件运行实践
两数相加 源文件:Addition.java 源代码: // An addition program import javax.swing.JOptionPane; // import class ...
- ArchLinux - 安装指南
Step 1 将镜像写入u盘 u盘从来不是唯一的选择,但多数人可能喜欢这么做. 我是在OS X上进行操作,如果你用的是windows,也许可以使用Image Writer for Windows或者U ...
- [日常] Redis基本使用测试
Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作数据库.缓存和消息中间件. 它支持多种类型的数据结构,如 字符串(strings), 散列(hashes), 列表(list ...
- Xcode 8 媒体权限
- 修改request请求参数
本质上来讲,request请求当中的参数是无法更改的,也不能添加或者删除: 但在后台程序中,一般对request的参数的操作,都是通过request的getParameter.getParameter ...
- Linux : task work 机制
task work机制可以在内核中向指定的进程添加一些任务函数,这些任务函数会在进程返回用户态时执行,使用的是该进程的上下文.包括下面的这些API: task_work_add task_work_c ...
- java网络编程(UDP详解)
UDP详解 一,TCP/IP协议栈中,TCP协议和UDP协议的联系和区别? 联系: TCP和UDP是TCP/IP协议栈中传输层的两个协议,它们使用网络层功能把数据包发送到目的地,从而为应用层提供网络服 ...
- hexo的next主题个性化教程:打造炫酷网站
看到有些next主题的网站很炫酷,那么是怎么配置的呢?接下来我会讲一讲如何实现一些炫酷的效果 主要有以下32种: 在右上角或者左上角实现fork me on github 添加RSS 添加动态背景 实 ...