您的位置:首页 > 移动开发 > IOS开发

MBProgressHUD不能立即显示问题

2017-06-29 13:54 573 查看
今天使用HUD在tableview的代理方法didSelectRowAtIndexPath中使用HUD不能立即显示



问题原因

UIKit 不能在当前run loop结束前重画,即需要在下一个run loop 周期才能重画,更新UI。

解决方案

手动运行NSRunLoop

即:

// Setup and show HUD here

[[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantPast]];

// Insert your code here
// Hide the shown HUD here
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息