工具栏sethidden = TRUE,sethidden = FALSE
问题描述:
我想隐藏我的工具栏,如果我点击一个按钮,但它似乎不工作。我可以用动画隐藏工具栏,但我不能让它再次显示。谢谢!工具栏sethidden = TRUE,sethidden = FALSE
- (IBAction)hideTheToolBar{
//[toolBar setHidden:YES];
if (toolbar.hidden == NO)
{
[UIView animateWithDuration:0.25 delay:0.0
options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction
animations:^(void)
{
toolbar.alpha = 0.0f;
}
completion:^(BOOL finished)
{
toolbar.hidden = YES;
}
];
}
if (toolbar.hidden == YES) {
toolbar.hidden = NO;
}
}
答
我觉得你是缺少在第二一份声明中,如果循环尝试:
if (toolbar.hidden == YES) {
toolbar.hidden = NO;
toolbar.alpha = 1.0f ;
}
+0
是啊,这工作!谢谢! – AmiiQo 2012-03-28 15:51:58
尝试还设置Alpha回到1 – Demz 2012-03-28 09:52:45