测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可 | MIT |
发布上次发布 | 2016年3月 |
由 Anton Kononenko 维护。
一种模拟 iOS 6 状态栏上方通知视图的 APP 内部通知视图。支持 iOS 4.3 及以上版本。
UILabels
和一个 UIImageView
使用以下调用显示消息和相关详细文本
[MPNotificationView notifyWithText:@"Grumpy wizards" andDetail:@"make a toxic brew for the jovial queen"];`
或使用以下调用添加缩略图图像并自定义持续时间
[MPNotificationView notifyWithText:@"Moped Dog:"
detail:@"I have no idea what I'm doing..."
image:[UIImage imageNamed:@"mopedDog.jpeg"]
andDuration:5.0];
或者如果您需要异步使用 AFNetworking
加载图像
MPNotificationView* notification =
[MPNotificationView notifyWithText:@"Moped Dog:"
detail:@"I have no idea what I'm doing..."
image:nil
andDuration:5.0];
//From UIImage+AFNetworking.h:
[notification.imageView setImageWithURL:[NSURL URLWithString:@"https://dl.dropbox.com/u/361895/mopeddog.png"]];
可以通过 blocks 实现触摸处理
[MPNotificationView notifyWithText:@"Grumpy wizards"
detail:@"make a toxic brew for the jovial queen"
andTouchBlock:^(MPNotificationView *notificationView) {
NSLog( @"Received touch for notification with text: %@", notificationView.textLabel.text );
}];
也可以通过指定一个实现 MPNotificationViewDelegate
的代理,最后处理 kMPNotificationViewTapReceivedNotification
通知。
由 Engin Kurutepe 在 Moped 的 柏林 开发。
在推特上关注我们:@moped
感谢 kovpas 的杰出贡献,包括但不限于对 iPad 的良好支持。
还从 Bruno Wernimont 的 BWStatusBarOverlay 中借鉴了一些想法。谢谢。
版权所有 (c) 2013 Engin Kurutepe - Moped Inc。
任何人免费获得此软件及其相关文档文件(“软件”)的副本,不经限制地处理该软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件副本,并允许向软件提供者提供软件的人这样做,前提是满足以下条件
上述版权声明和此许可声明应包含在软件的副本中或其主要部分中。
本软件按“原样”提供,不提供任何形式的保证,无论是明示的还是默示的,包括但不限于适销性、特定目的的适用性和非侵权性保证。在任何情况下,作者或版权持有人不应对任何索赔、损害或其他责任负责,无论是基于合同行为、侵权或其他原因,这些都与软件或软件的使用或其他处理有关。