测试被测试 | ✗ |
语言语言 | Objective-CObjective C |
许可证 | MIT |
发布最后发布 | 2015年3月 |
由 Christian Schwarz 维护。
易于使用、半透明且模糊的通知视图,可以轻松地添加到 UIView
、UITableView
、UICollectionView
中。还支持显示进度。
支持 iOS 7 和 iOS 8。需要 Xcode 6。
[CSNotificationView showInViewController:self
style:CSNotificationViewStyleError
message:@"A critical error happened."];
[CSNotificationView showInViewController:self
style:CSNotificationViewStyleSuccess
message:@"Great, it works."];
CSNotificationView* note = (...);
note.showingActivity = YES;
[note setVisible:YES animated:YES completion:nil];
(...)
[note dismissWithStyle:CSNotificationViewStyleSuccess message:@"Success!"
duration:kCSNotificationViewDefaultShowDuration animated:YES];
使用 block 回调来处理通知上的点击事件
__block typeof(self) weakSelf = self;
self.loadingNotificationView.tapHandler = ^{
[weakSelf cancelOperationXYZ];
[weakSelf.loadingNotificationView dismissWithStyle:CSNotificationViewStyleError
message:@"Cancelled"
duration:kCSNotificationViewDefaultShowDuration animated:YES];
};
note.image = [UIImage imageNamed:@"mustache"];
[CSNotificationView showInViewController:self
tintColor:[UIColor colorWithRed:0.000 green:0.6 blue:1.000 alpha:1]
image:nil
message:@"No icon and a message that needs two rows and extra \
presentation time to be displayed properly."
duration:5.8f];
查看 LICENSE.md