mutualmobile / MMProgressHUD

An easy-to-use HUD interface with personality.
MIT License
705 stars 131 forks source link

MMProgressHUDPresentationStyleNone is unexpectantly animating #7

Closed crosebrugh closed 11 years ago

crosebrugh commented 11 years ago

Maybe this is an iOS 7 thing, but setting

MMProgressHUD.sharedHUD.presentationStyle = MMProgressHUDPresentationStyleNone

is animating the HUD by flying in from the top left corner.

Is this expected?

larsacus commented 11 years ago

Make sure you are not calling any MMProgressHUD display methods in an animation block or an animation context.

crosebrugh commented 11 years ago

I'm pretty sure that I'm not. Even put the calls in a NSTimer.scheduledTimerWithTimeInterval with 3 second delay.

I'm using RubyMotion and am new to ObjC iOS dev so not sure where to look next.

On Fri, Oct 4, 2013 at 9:03 PM, Lars Anderson notifications@github.comwrote:

Make sure you are not calling any MMProgressHUD display methods in an animation block or an animation context.

— Reply to this email directly or view it on GitHubhttps://github.com/mutualmobile/MMProgressHUD/issues/7#issuecomment-25741612 .

larsacus commented 11 years ago

I have never worked with RubyMotion before, so I won't really be much help in this regard. Sorry.

How are you calling the HUD onscreen?

crosebrugh commented 11 years ago

I doubt that RM is part of the issue here. It just calls the ObjC methods. I mention it only to disclose my lack of ObjC experience.

Have you compiled with Xcode5 for iOS7-only?

I tried every type of presentationStyle and some work as expected while others just come in from the top left

        MMProgressHUDPresentationStyleDrop # as expected
        MMProgressHUDPresentationStyleExpand # from top left
        MMProgressHUDPresentationStyleShrink # from top left
        MMProgressHUDPresentationStyleSwingLeft # as expected
        MMProgressHUDPresentationStyleSwingRight # as expected
        MMProgressHUDPresentationStyleBalloon # as expected
        MMProgressHUDPresentationStyleFade # from top left
        MMProgressHUDPresentationStyleNone # from top left

Here's how I call it:

        @busy = MMProgressHUD.sharedHUD
        @busy.overlayMode = MMProgressHUDWindowOverlayModeNone
        @busy.presentationStyle = MMProgressHUDPresentationStyleNone
        @busy.hud.displayStyle = MMProgressHUDDisplayStyleBordered
        # Note that if this isn't called then the HUD doesn't set the size correctly for a two-line status message
        @busy.hud.buildHUDAnimated(true)
        MMProgressHUD.showWithStatus(msg)
larsacus commented 11 years ago

I am currently using and know of many projects being compiled for iOS 7 with Xcode 5 that are working properly.

I can almost guarantee it is because you are calling the buildHUDAnimated: method. That is not really a public method that is meant to be called by anyone except by the internal implementation.

If you're having an issue with the label, that is a different issue altogether.

crosebrugh commented 11 years ago

Your guarantee is 100%. Removing buildHUDAnimated(true) does fix the animation issues.

I'm now calling buildHUDAnimated(false) to fix the layout (the multi-line status) and all is well.

Thanks.