0
我有一個UIButton,它使UIToolbar顯示和隱藏。UIToolbar隱藏後不顯示
- (IBAction)showHideToolbar:(id)sender{
if (toolBar.hidden == NO) {
[UIView animateWithDuration:0.25 delay:0.0 options:UIViewAnimationCurveLinear | UIViewAnimationOptionAllowUserInteraction animations:^(void){toolBar.alpha =0.0f;}completion:^(BOOL finished){
toolBar.hidden = YES;}];
NSLog(@"hides");
}
else
if (toolBar.hidden == YES) {
[UIView animateWithDuration:0.25 delay:0.0 options:UIViewAnimationCurveEaseIn | UIViewAnimationOptionAllowUserInteraction animations:^(void){toolBar.alpha =0.0f;}completion:^(BOOL finished){
toolBar.hidden = NO;
}];
NSLog(@"show");
}
}
的問題是,當我試圖隱藏工具欄,它工作正常。但是當我嘗試再次顯示它時,它不會顯示出來。 任何想法?
非常感謝你!成功了! :) – Phillip