gpt4 book ai didi

ios - 将 UIAlertView 用于 GetReady 标题

转载 作者:行者123 更新时间:2023-11-29 03:09:04 25 4
gpt4 key购买 nike

我正在尝试使用 UIAlertView 调出准备就绪的标题,然后将其拉出屏幕,让玩家知道游戏开始了。我如何使用 UIAlertView 执行此操作?

最佳答案

试试这个方法...

UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"Get Ready!" message:nil     delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];;

[alertView show];

[self performSelector:@selector(dismissReadyAlert:) withObject:alertView afterDelay:3.0];

-(void)dismissReadyAlert:(UIAlertView *)alertView
{
[alertView dismissWithClickedButtonIndex:0 animated:NO];

alertView.title = @"Your game is started!";

[alertView show];

[self performSelector:@selector(dismissStartAlert:) withObject:alertView afterDelay:2.0];
}

-(void)dismissStartAlert:(UIAlertView *)alertView
{
[alertView dismissWithClickedButtonIndex:0 animated:YES];
}

谢谢!

关于ios - 将 UIAlertView 用于 GetReady 标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22419317/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com