
hud = [[MBProgressHUD alloc] init];[hud showWhileExecuting:@selector(loaDWorkbench:) onTarget:self withObject:nil animated:YES];
但它永远不会出现,应用程序看起来冻结给最终用户.我出错了什么想法?
解决方法 是.它不会出现,因为你永远不会告诉我将HUD添加为窗口的子视图.尝试类似的东西:// Should be initialized with the windows frame so the HUD disables all user input by covering the entire screen HUD = [[MBProgressHUD alloc] initWithWindow:[UIApplication sharedApplication].keyWindow]; // Add HUD to screen [self.vIEw.window addSubvIEw:HUD]; // Register for HUD callbacks so we can remove it from the window at the right time HUD.delegate = self; HUD.labelText = NSLocalizedString(@"Loading Workbench",nil); HUD.detailsLabelText = NSLocalizedString(@"please wait",nil); // Show the HUD while the provIDed method executes in a new thread [HUD showWhileExecuting:@selector(loaDWorkbench:) onTarget:self withObject:nil animated:YES];
由于您将自己设置为HUD委托,因此还要添加以下委托方法:
- (voID)huDWasHIDden { // Remove HUD from screen [HUD removeFromSupervIEw]; // add here the code you may need} 并记得在相应的头文件中添加MBProgressHUDDelegate.
总结以上是内存溢出为你收集整理的iphone – MBProgressHUD没有显示全部内容,希望文章能够帮你解决iphone – MBProgressHUD没有显示所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)