Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M13ProgressHUD appearing from top left corner when shown from UITableViewController #25

Closed
HaikuOezu opened this issue Mar 13, 2014 · 3 comments

Comments

@HaikuOezu
Copy link

I have created a fairly standard setup for an app; a UINavigationController (no custom class) with a UITableViewController as its root controller, displaying a list of items fetched from a server and I want to show a HUD to show the progress.

This is the code I'm using; it is taken straight from the sample app

- (void)viewDidLoad
{
    [super viewDidLoad];

    HUD = [[M13ProgressHUD alloc] initWithProgressView:[[M13ProgressViewRing alloc] init]];
    HUD.progressViewSize = CGSizeMake(60.0, 60.0);
    UIWindow *window = ((LPAppDelegate *)[UIApplication sharedApplication].delegate).window;
    [window addSubview:HUD];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [HUD show: YES];
}

The HUD works but instead of "popping" from the middle of the screen it "grows" from the top left angle of the screen to its full size.

I looked allover the sample project to find differences and the only thing I'm doing different aside from performing this on viewDidAppear is that I'm calling this from a UITableViewController.
I tried moving this to a UIViewController and it works perfectly (even with said ViewController being part of a navigation stack) so it seems it is the table view controller's fault

Any idea why this is happening? I found that editing M13ProgressHUD.m's layoutHUD and moving

    backgroundView.frame = CGRectIntegral(backgroundRect);
    _progressView.frame = CGRectIntegral(progressRect);

outside the UIView animateWithDuration block fixes the issue, but it doesn't look ideal and since it only happens inside the UITableView there must be something else causing it.

@Marxon13
Copy link
Owner

Please take a look at the animationPoint property of the HUD. Let me know if setting that works for you.

@HaikuOezu
Copy link
Author

I did try setting the animationPoint to CGPointMake([UIScreen mainScreen].bounds.width/2, [UIScreen mainScreen].bounds.height/2) and while the HUD does appear from the middle of the screen the "origin" point of the scale animation is still its top left corner.

@Marxon13
Copy link
Owner

I know that UITableView does some weird things, Like the lines between the table rows are drawn above the self.view of the UITableViewController. I'll create an example and see if I can fix it.

Marxon13 pushed a commit that referenced this issue Apr 8, 2014
* Fixed a bug where the HUD would not respond to the animation point.
* The animation point now performs as described in the documentation.
@Marxon13 Marxon13 closed this as completed Apr 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants