有没有办法在一段时间后关闭没有按钮的 UIalertView ?
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"tittle"
message:@""
delegate:self
cancelButtonTitle:@""
otherButtonTitles:nil];
[alertView show];
[alertView release];
我想在显示一段时间后关闭alerview,但是当alertview没有按钮时,如果我调用-dismissWithClickedButtonIndex:animated:方法
和-performSelector:withObject,它就不起作用:延迟后:
还有其他方法可以驳回吗? 感谢您的任何想法!
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"tittle"
message:@""
delegate:self
cancelButtonTitle:@""
otherButtonTitles:nil];
[alertView show];
[alertView release];
i want to dimiss the alerview after it's showing for some time,but when the alertview has no button,it doesn't work if i invoked -dismissWithClickedButtonIndex:animated: method
and-performSelector:withObject:afterDelay:
is there any other way to dismiss it ?
thanks for any ideas!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
就是这样,我修好它
that's it.i fix it
使用 10 秒延迟来关闭
Use 10 seconds delays to dismiss
在 Xamarin.iOS / Monotouch 中,这对我有用:
请记住,如果从后台线程(而不是主 UI 线程)调用异步方法,则仍然需要 InvokeOnMainThread。
这仅仅意味着您像这样调用上面的方法:
In Xamarin.iOS / Monotouch this worked for me:
Remember that if an async method is called from a background thread (not the main UI thread) then InvokeOnMainThread would still be required.
This just means that you call the above method like this:
更新上面的答案,因为
UIAlertView
已弃用
在此链接回答
第二个函数应该是这样的
update to the answer above as
UIAlertView
isdeprecated
Answer At this Link
the 2nd function should be like this