Tag: mbprogresshud

iOS – 全局更改MBProgressHUDdevise

我使用MBProgressHUD在我的应用程序中加载屏幕。 我有26次出现,我使用不同的HUD。 现在,我决定为HUD使用自定义的UIView(一个UIImageView)。 我想将这个应用到我在我的应用中使用的所有HUD,但是定制HUD的代码长度大概是15行,而且在我的应用中将这个代码添加到MBProgressHUD的每一次出现绝对不是正确的方法。 什么是正确的方式从这里走? 这不是我第一次遇到像这样的问题,我不知道如何保持我的代码更清洁和简单。

iOS的Cocoapods -pod(MBProgressHUD)安装给错误卡在“分析依赖”和“头文件丢失”

我已经安装了2荚MBProgessHUD和PEPhotocropEditor它的工作正常,直到现在,但突然我得到MBProgressHUD.h文件错误不可用。 而且我用pod update和pod install命令尝试了它,但仍然无法解决问题。 当我把这两个命令terminal都搞砸了 分析依赖关系。 和豆荚在看红色。

同样的情况,第二次被拒绝,因为使用了MBProgressHUD :(

拒绝原因:活动指示器旋转不准,用户无法访问内容 同样的情况,第二次因为使用MBProgressHUD而被拒绝。 谁能告诉我已上传到appstore应用程序会有什么不同? 我做了各种各样的testing,这样的问题没有出现在本地。 —————————–在我的控制器里—————————– —————– – (void)downloadList { if (isLoading) { return; } isLoading = YES; //do something…… //show the progressbar based on MBProgressHUD [[MyDelegate getAppDelegate] showProgressBarForTarget:self whileExecuting:@selector(showProgressBarForLoading)]; } } – (void)showProgressBarForLoading { while (isLoading) { //i++; continue; } } – (void)downloadListDidReceive:(XGooConnection*)sender obj:(NSObject*)obj { //do something…… isLoading = NO; } —————————–在我的AppDelegate中—————— ————- – (void)showProgressBarForTarget:(id)target […]

MBProgressHud和SDWebImagePrefetcher

我试图显示一个自定义的MBProgressHUD同时使用NSURLConnection方法下载MBProgressHUD的URL列表。 SDWebImagePrefetcher有一个方法,当被调用时,在控制台中显示图像下载的进度。 现在,我想展示NSLog在自定义MBProgressHUD中的MBProgressHUD ,我希望HUD能够保持在屏幕上,直到完成这个过程,但是我不知道该怎么做,再加NSURLConnection我的NSURLConnection方法被调用时,它显示最初的HUD(连接),然后快速跳转到“完成”,即使图像仍然需要下载。 这是我的代码: – (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { HUD.mode = MBProgressHUDModeDeterminate; } – (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { HUD.labelText = @"Loading"; HUD.detailsLabelText = @"Downloading contents…"; //here, i would like to show the progress of the download, but it seems to jump this part HUD.dimBackground = YES; } – (void)connectionDidFinishLoading:(NSURLConnection *)connection { //arr […]

MBProgressHUD在多行显示标签文本

嗨,我的iPad屏幕上有一个MBProgressHUD。 工作得很好。 但是我想把标签改成三行显示。像这样 self.hud = [[MBProgressHUD alloc] initWithView:self.navigationController.view]; self.hud.frame = CGRectMake(0, 0, 120, 143); [self.navigationController.view addSubview:self.hud]; self.hud.delegate = self; self.hud.mode = MBProgressHUDModeAnnularDeterminate; NSString *strloadingText = [NSString stringWithFormat:@"Loading Data.\r Please Wait.\r 1-2 Minutes"]; NSLog(@"the loading text will be %@",strloadingText); self.hud.labelText = strloadingText; [self.hud show:YES]; 所以我想要3行中的标签 加载数据中。 请稍候 1-2分钟 或者我可以分配一个图像的HUD? 所有这些都应该在labeltext中。 但是我只有一条线。 我怎样才能做到这一点? 如果您需要更多信息,请询问。谢谢。

MBProgreeHud与gif图像

我可以使用gif图像而不是默认加载? 我到目前为止使用这个代码,但没有得到任何结果。 任何人都可以提出这个代码有什么问题吗? #import "UIImage+GIF.h" -(void) showLoadingHUD:(NSString *)title { [self hideLoadingHUD]; if(!HUD){ HUD = [MBProgressHUD showHUDAddedTo:self.window animated:YES]; } [HUD setColor:[UIColor clearColor]]; UIImageView *imageViewAnimatedGif = [[UIImageView alloc]init]; imageViewAnimatedGif.image= [UIImage sd_animatedGIFNamed:@"martini_glass"]; HUD.customView = [[UIImageView alloc] initWithImage:imageViewAnimatedGif.image]; CABasicAnimation *rotation; rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; rotation.fromValue = [NSNumber numberWithFloat:0]; rotation.toValue = [NSNumber numberWithFloat:(2 * M_PI)]; rotation.duration = 0.7f; // Speed […]

全球使用MBProgressHUD +使其成为单身人士

在我的项目中,每个用户交互事件都会进行networking调用(即TCP,而不是HTTP)。 我需要活动指标是全局的,以显示从随机UIViewController和隐藏从NetworkActivityManager类(处理networking活动,这不是UIViewController或UIView的子类的自定义类) 隐藏 。 在search网页后,我发现MBProgressHUD用于同样的目的,但我无法find一个关于如何在全球范围内使用它的例子。 (通过说全局我是指MBProgressHUD的单例对象和类方法来显示和隐藏它。) 以下是我已经尝试过,但失败了:在AppDelegate.h: @property (nonatomic, retain) MBProgressHUD *hud; 在AppDelegate.m中: @synthesize hud; 在一些随机的UIViewController对象中: appDelegate.hud = [MBProgressHUD showHUDAddedTo:appDelegate.navigationController.topViewController.view animated:YES]; appDelegate.hud.labelText = @"This will take some time."; 在隐藏它的时候,从NetworkActivityManager类: [MBProgressHUD hideHUDForView:appDelegate.navigationController.topViewController.view animated:YES]; 这使得项目在一段时间后崩溃(由于内存问题)。我在我的项目中使用ARC,并且还使用ARC版本的MBProgressHUD 。 我错过了什么吗? 重要问题: 我可以让MBProgressHUD像UIAlertView 一样工作吗? (说我的意思是独立于UIView的MBProgressHUD的实现 – 它使用showHUDAddedTo:呈现自己)? 请注意:在隐藏MBProgressHUD的上述代码中,View可能与显示MBProgressHUD时的内容有所不同。 任何帮助不胜感激。

将MBProgressHUD放置在屏幕的底部/顶部

有没有办法使MBProgressHUD显示在屏幕的底部或顶部? 我已经尝试使用[hud setFrame:….];设置框架[hud setFrame:….]; , initWithFrame ,并设置hud的center属性。 这些都没有工作。 尝试这些方法后,我做了一个NSLog()帧。 值已经改变,但仍然显示在屏幕的中心。 需要注意的是,使用UIWindow显示hud: UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:window animated:YES]; hud.mode = MBProgressHUDModeText; hud.labelText = @"some text"; 这是因为hud是由后台执行块显示的,因此hud可以显示在当前显示的任何视图上。