下载地址:https://github.com/scalessec/Toast

Toast for iOS

Version 2.0

Toast is an Objective-C category that adds Android-style toast notifications to the UIView object class. It is intended to be simple, lightweight, and easy to use.

What's New

  • Completely refactored the library to take advantage of modern Objective-C. When the first version of this category was written years ago, blocks didn't exist and dot notation for properties was still controversial. Needless to say, it's been updated.
  • If you're using ARC, you'll need to add the-fno-objc-arccompiler flag toToast+UIView.m. All preprocessor conditions have been removed.
  • Minimum iOS target is 4.0

Screenshots

Examples

// basic usage[self.view makeToast:@"This is a piece of toast."];// toast with duration, title, and position[self.view makeToast:@"This is a piece of toast with a title."              duration:3.0             position:@"top"                title:@"Toast Title"];// toast with an image[self.view makeToast:@"This is a piece of toast with an image."             duration:3.0            position:[NSValue valueWithCGPoint:CGPointMake(110, 110)]               image:[UIImage imageNamed:@"toast.png"]];// display toast with an activity spinner[self.view makeToastActivity];

See the demo project for more examples.

Setup Instructions

  1. AddToast+UIView.h&Toast+UIView.mto your project.
  2. Link against QuartzCore.
  3. If you're using ARC, you'll need to add the-fno-objc-arccompiler flag toToast+UIView.m.

MIT License

Copyright (c) 2013 Charles Scalesse.Permission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall be includedin all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. android文件打开方式
  2. 类微信播放音频帧动画实现
  3. AndroidAnnotations——SharedPreference
  4. 自定义ViewGroup onMeasure onLayout
  5. Android几种定时器的使用
  6. 7.高级UI组件
  7. 漂亮的Android加载动画
  8. android 7.0 user版本调试方法
  9. android SharePreference适用任何基本类
  10. 802.11(wifi)中SSID、BSSID、ESSID的区别