我需要知道是否有在iOS中其行为类似于Android的吐司消息的任何方法。也就是说,我需要显示这是几秒钟后自动关闭的消息。这是类似于吐司类的在Android环境的功能。
I need to know if there is any method in iOS which behaves like Toast messages in Android. That is, I need to display a message which is dismissed automatically after few seconds. This is similar to the functionality of the Toast class in the Android environment.
您可以使用 MBProgressHUD
项目。
You can make use of MBProgressHUD
project.
使用HUD模式 MBProgressHUDModeText
的面包般的行为,
Use HUD mode MBProgressHUDModeText
for toast-like behaviour,
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES];
// Configure for text only and offset down
hud.mode = MBProgressHUDModeText;
hud.labelText = @"Some message...";
hud.margin = 10.f;
hud.yOffset = 150.f;
hud.removeFromSuperViewOnHide = YES;
[hud hide:YES afterDelay:3];
希望帮助!
上一篇:GoogleApiClient.connect()'预计是类型的接口,但被认为是虚拟接口、类型、GoogleApiClient、connect
下一篇:PhoneGap的 - 处理推送通知,一旦我离开了索引范围与window.location.replace索引、离开了、范围、通知