ios - MBProgressHUD not staying on screen for designated time using hide afterDelay -
i've searched around quite awhile looking solution (plus big amount of time troubleshooting issue on own.) i'm trying create general-purpose pop-up message utilize @ various places in application, having problem keeping message on screen. specifically, i'm trying leave message on screen 2 seconds before automatically disappears. i'm using mbprogresshud accomplish this. here code:
-(void)showmessage{ mbprogresshud *buttonclickmessage; buttonclickmessage = [[mbprogresshud alloc] initwithview:self.view]; buttonclickmessage.labeltext = @"test"; buttonclickmessage.mode = mbprogresshudmodetext; [self.view addsubview:buttonclickmessage]; [buttonclickmessage show:yes]; [buttonclickmessage hide:yes afterdelay:10]; }
anytime effort phone call [self showmessage]
in code message flashes briefly on screen, i.e.: doesn't lastly 10 seconds specified in code included above. know why? give thanks you.
also, here code mbprogresshud:
- (void)hide:(bool)animated afterdelay:(nstimeinterval)delay { [self performselector:@selector(hidedelayed:) withobject:[nsnumber numberwithbool:animated] afterdelay:delay]; } - (void)hidedelayed:(nsnumber *)animated { [self hide:[animated boolvalue]]; }
ios xcode mbprogresshud
No comments:
Post a Comment