WToast 是一款受 Android Toast 启发的简单信息框,适用于 iOS。
需求
iOS 8.0 及以上。
功能
- 显示带自定义文本的 Toast 对象
- 显示带自定义图像的 Toast 对象
使用方法
显示带文本的 Toast
[WToast showWithText:@"This is a short test."];
[WToast showWithText:@"This is a long test." duration:kWTLong];
[WToast showWithText:@"This is a long test." duration:kWTLong roundedCorners:YES];
[WToast showWithText:@"This is a long test." duration:kWTLong roundedCorners:YES gravity:kWTGravityMiddle];
显示带图像的 Toast
[WToast showWithImage:[UIImage imageNamed:@"toast-image"]];
[WToast showWithImage:[UIImage imageNamed:@"toast-image"] duration:10];
[WToast showWithImage:[UIImage imageNamed:@"toast-image"] duration:12 roundedCorners:NO];
[WToast showWithImage:[UIImage imageNamed:@"toast-image"] duration:12 roundedCorners:NO gravity:kWTGravityTop];
隐藏当前提示框
[WToast hideToast];
[WToast hideToastAnimated:YES];
演示
许可
这个小程序是公有领域作品。如果你喜欢,可以提及 Brite Apps。