mbprogresshud

MBProgressHUD的基本使用

百般思念 提交于 2019-12-09 19:47:30
//方式1.直接在View上show HUD = [[MBProgressHUD showHUDAddedTo:self.view animated:YES] retain]; HUD.delegate = self; //常用的设置 //小矩形的背景色 HUD.color = [UIColor clearColor]; //这儿表示无背景 //显示的文字 HUD.labelText = @ "Test" ; //细节文字 HUD.detailsLabelText = @ "Test detail" ; //是否有庶罩 HUD.dimBackground = YES; [HUD hide:YES afterDelay:2]; //只显示文字 MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; hud.mode = MBProgressHUDModeText; hud.labelText = @ "Some message..." ; hud.margin = 10.f; hud.yOffset = 150.f; hud.removeFromSuperViewOnHide = YES; [hud hide:YES afterDelay:3]; //方式2.initWithView /

MBProgressHUD的两个注意点

假装没事ソ 提交于 2019-12-09 19:41:02
注意点一 removeFromSuperview Unlinks the receiver from its superview and its window, and removes it from the responder chain. 译:把当前view从它的父view和窗口中移除,同时也把它从响应事件操作的响应者链中移除。 分析: 这里有两个关键点,可以帮助我们理解在ios当中view是怎么来组织的:a.视图的组织形式;b.响应者链。 在ios当中,视图的设计模式可以看做是组件模式,即以树作为存储的数据结构,这种数据结构具有明确的两个特点: 1.父子关系分明,从根节点出发,通过叶节点向下扩展,同一枝的上一个节点就是下一个节点的superview,下一个节点就是上一个节点的subview;不同枝如果同层,则为兄弟节点。 2.layer关系分明,layer在ios中对事件响应具有举足轻重的作用,通常两个重叠的控件,处在上层的会优先响应; 从上面文档的描述,我们可以看到,这两个特性,也是view在操作时候的核心, 即一个view的操作关系到两个方面,视图结构和响应者链。 removeFromSuperview,类似一个剪枝,执行此函数,就等于在树形结构中找到该节点,剪去该节点及其子节点,而并非只是剪去该节点自己。同时,另一个操作就是把该对象从响应者链中移除。 - (void

How to fix the position of MBProgressHUD to center in a UITableView

杀马特。学长 韩版系。学妹 提交于 2019-12-08 17:40:15
问题 I have a scenario where I am using third party library MBProgressHUD on a UITableViewController but the issues is whenever I scroll up and down the HUD moves with the scroll. I don't want to disable the UITableView scroll and also I want to keep the HUD in the centre of the UITableView. Is there a possible way of implementing it? 回答1: Adding HUD to the tableview's super view or navigationController.view fixes the problem: UIView *view = self.tableView.superview; // UIView *view = self

The same situation,Second time be rejected because of used MBProgressHUD :(

我怕爱的太早我们不能终老 提交于 2019-12-08 15:34:52
问题 Reasons for Rejection: The activity indicator spins indefinetely and the user can't access the content The same situation,Second time be rejected because of used MBProgressHUD. Who can tell me Uploaded to appstore app would be any different? I done various tests, such a problem did not appear in the local. -----------------------------in my controller----------------------------------- - (void)downloadList { if (isLoading) { return; } isLoading = YES; //do something...... //show the

MBProgressHUD to show label text in more than one line

大憨熊 提交于 2019-12-03 11:19:11
问题 Hi i have a MBProgressHUD on my iPad screen. Works perfectly fine. But i want to change the label to show in three lines.Like this 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(

MBProgressHud with gif image

≯℡__Kan透↙ 提交于 2019-12-03 08:46:29
Can I use gif image instead of default loading indicator? I am using this code so far but not getting any result. Can anyone suggest what is wrong in this code? #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

Why is a static library's header file not found for archiving?

蓝咒 提交于 2019-12-03 03:51:30
问题 I can build for debugging just fine. I've triple checked that the static library is included in the build phases settings for the project. I've also tried other things like header include paths and such to no avail. When I try to build an IPA for test flight, I get an error: #import <MBProgressHUD/MBProgressHUD.h> I've been able to build an IPA before, but it didn't implement/use the MBProgressHUD static library before. I can include the the header and code file manually instead of statically

MBProgressHUD to show label text in more than one line

半世苍凉 提交于 2019-12-03 01:44:06
Hi i have a MBProgressHUD on my iPad screen. Works perfectly fine. But i want to change the label to show in three lines.Like this 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

How to use MBProgressHUD with swift

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: here is my code , but it showing the progress . is there any error in this code? please give some idea to fix this, or give some link related to this. class Approval: UIViewController { var hud: MBProgressHUD = MBProgressHUD() override func viewDidLoad() { super.viewDidLoad() fetchData() } func fetchData(){ hud.show(true) // doing some http request dispatch_async(dispatch_get_main_queue()) { hud.hide(true) } } } 回答1: Updated Answer: let loadingNotification = MBProgressHUD.showAdded(to: view, animated: true) loadingNotification.mode =

Use of MBProgressHUD Globally + make it singleton

那年仲夏 提交于 2019-11-29 19:39:14
In my Project, each of the user interaction events make a network call (Which is TCP, not HTTP). I need Activity Indicator to be global to show from a random UIViewController and hide from NetworkActivityManager Class (a custom class to handle network activities, Which is not a subclass of UIViewController or UIView). After searching the web I found out that MBProgressHUD is used for the same purpose, but I wasn't able to find out an example on how would I use it globally. (By saying global I mean a singleton object of MBProgressHUD and class methods to SHOW and HIDE it.) Following is what I