JTFadingInfoView
是一个基于 UIButton 子类的类似 Google 的 Material Design 通知视图,具有平滑的淡入淡出动画功能。
您可以任意选择淡入/淡出方向。此外,可自定义的属性可以调整行为并增强您的应用程序 UI 的酷炫效果。
使用此库,您可以轻松地将浮动应用内通知集成到您的应用程序中,例如登录成功/失败通知消息。
JTFadingInfoView 可在 CocoaPods 上使用。
您可以通过将以下命令添加到您的 Podfile 来使用此库
pod "JTFadingInfoView"
基本设置
CGRect frame = CGRectMake(150, 200, 150, 50);
NSString *label = @"JTFadingInfoView!";
JTFadingInfoView *infoView = [[JTFadingInfoView alloc] initWithFrame:frame
label:label];
[self.view addSubview:infoView];
JTFadingInfoView 具有参数来按需自定义行为
/** A float represeting the time for displaying this view itself (second).
/** If <= 0, view will not disappear */
@property float displayDuration;
/** A float representing the time the view is appeared by (second). */
@property float appearingDuration;
/** A float representing the time the view is disappeared by (second). */
@property float disappearingDuration;
/** A float representing how much the view moves during fading in/out. */
@property float animationMovement;
/** A JTFadeInType representing from which direction the view appears */
@property JTFadeInDirectionType fadeInDirection;
/** A JTFadeInType representing to which direction the view will be disappeared */
@property JTFadeOutDirectionType fadeOutDirection;
iOS 7.0 或更高版本
Junichi Tsurukawa [email protected]
JTFadingInfoView 根据 MIT 许可证提供。