uiview移动动画后不接受触摸

时间:2013-04-01 15:12:54

标签: ios objective-c uiview

我在UIviewController界限下面有一个uiview位置 而且我从下到上动画它的外观(如动作表)

- (IBAction)Button:(id)sender {

   [UIView beginAnimations:nil context:NULL];
   [_pickerView setFrame:CGRectMake(0.0f, self.view.frame.size.height - _pickerView.frame.size.height , 0.0f, 0.0f)];
   [UIView commitAnimations];   
}
uiview之后的问题似乎没有用户与视图的互动 我错过了什么?

2 个答案:

答案 0 :(得分:0)

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationBeginsFromCurrentState:YES];
    [UIView setAnimationDuration:0.6f];
[_pickerView setFrame:CGRectMake(@"As U Want")];
    [UIView commitAnimations];
}

[UIView setAnimationDuration:0.6f];这一行非常重要:)

答案 1 :(得分:0)

frame的{​​{1}}没有宽度或高度。很可能您的组件仍然出现,因为您的视图不会“剪辑子视图”。

您的代码:

view

结果是,您可以看到元素,但不能与它们交互。当我想我已经完成了这个时,我设置了我的视图的背景颜色,这样我就能看到框架。