[翻译] 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 ...
随机推荐
- python开发环境安装配置
需要安装的软件: Python2.7.14和Python3.6.4 要在电脑上同时安装两个版本 开发工具:PyCharm 是一个jetbrains的python开发工具 idea系列之一 Pyt ...
- C#的Lambda表达式嵌套例子
/* *curStatsResult是List<string>类型, *x.GetAllOsVersion()结果是string[]类型, *这里是先使用SelectMany()返回一个结 ...
- C语言中的按位移动及其简单引用
C语言中的按位移动及其简单应用 在C语言中按位左移用”<<”表示,按位右移用”>>”表示. 按位左移和按位右移运算经常被用来替换乘二和除二运算,但是要注意,这两者之间并不完全等 ...
- XRP节点部署
目录 XRP节点部署 准备 硬软件配置(建议) 安装Rippled服务 一. 以Stock Server模型运行 在何种情况下运行此模式 二 .以 Validator模式运行 在何种情况下运行此模式 ...
- C#.NET下转换泛型列表为JSON格式
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Te ...
- hadoop学习笔记(十):MapReduce工作原理(重点)
一.MapReduce完整运行流程 解析: 1 在客户端启动一个作业. 2 向JobTracker请求一个Job ID. 3 将运行作业所需要的资源文件复制到HDFS上,包括MapReduce程序打包 ...
- .net core 2.2 部署CentOS7(2)给虚拟机安装CentOS7
目录: .net core 2.2 部署CentOS7(1)安装虚拟机 .net core 2.2 部署CentOS7(2)给虚拟机安装CentOS7 .net core 2.2 部署CentOS7( ...
- F#注解
不要问我为啥要学F#——因为气质摆在那里 标注:以下内容均来自 anderslly F#系列 1.类型推演 let square x = x * x //接受一个某类型参数的quare函数返回一个这个 ...
- static关键字的内存分析
通常情况下,Java把内存分为栈内存.堆内存和方法区 栈内存用来存放一些基本类型的变量和数组(数组也是一种引用类型)及对象的引用变量 堆内存主要是来放置对象的,即我们在程序中new出来的对象. sta ...
- mysql 中 max_allowed_packet 查询和修改
mysql 会根据配置文件限制 server 接收的数据包的大小. 有时候大的插入和更新会被 max_allowed_packet 参数限制,报如下错误: Packet > ). You can ...