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的更多相关文章

  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. Centos虚拟机SVN的安装和使用http方式访问svn服务器

    1.查看是否安装旧版SVNrpm -qa | grep subversion2.卸载旧版本SVNyum remove subversion3.安装SVNyum -y install subversio ...

  2. C#正则表达式合并连续空格为单个空格

    第一种方法: 使用 System.Text.RegularExpressions.Regex.Replace()方法 string result = String.Empty; string str ...

  3. nginx学习笔记(7)Nginx如何处理一个请求---转载

    如何防止处理未定义主机名的请求基于域名和IP混合的虚拟主机一个简单PHP站点配置 基于名字的虚拟主机 Nginx首先选定由哪一个虚拟主机来处理请求.让我们从一个简单的配置(其中全部3个虚拟主机都在端口 ...

  4. 再springMVC中自定义文件上传处理解决与原spring中MultipartResolve冲突问题

    相信很多朋友再用springmvc时都遇见了一个问题,那就是自带的获取上传的东西太慢,而且不知道如何修改,其实不然,spring框架既然给我们开放了这个接口,就一定遵从了可扩展性的原则,经过查看org ...

  5. win7 iis7 asp.net 编译器错误消息: CS0016:

    编译器错误消息: CS0016: 未能写入输出文件“c:/Windows/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root ...

  6. [转]COPY OR MOVE FILES AND FOLDERS USING OLE AUTOMATION

    本文转自:http://sqlindia.com/copy-move-files-folders-using-ole-automation-sql-server/ I love playing aro ...

  7. autofac使用Common Serivce Locator跟随wcf,mvc,web api的实例控制

    autofac本身只提供了基本的ioc容器的功能 要想在mvc,wcf,web api中使用,除了autofac本身,还需要引入对应的包(点击对应连接可查看文档) 除此之外,使用Common Serv ...

  8. 从Object对象中读取属性的值

    C#是强类型语言,强到多变态?一个对象没有定义某个属性,你想点出来,IDE直接给你报语法错误.远不如js那么自由,想怎么点怎么点. 如果你从别人接口中拿到的就是Object类型,你想获取某个属性的值怎 ...

  9. mysql 中 max_allowed_packet 查询和修改

    mysql 会根据配置文件限制 server 接收的数据包的大小. 有时候大的插入和更新会被 max_allowed_packet 参数限制,报如下错误: Packet > ). You can ...

  10. Java Swing实战(一)JFrame和JTabbedPane容器

    概述: 项目是一个桌面程序,涉及标签和按钮组件.布局管理器组件.面板组件.列表框和下拉框组件等组件,以及Swing事件处理机制. 下面先从最基础的界面开始. /** * @author: lishua ...