2013-04-01 50 views
0

我有以下的UIViewController一个UIView位置界定 我就是动画它的外形从底部到顶部(如actionsheet)的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]; 
} 

的poblem了之后的UIView似乎没有用户交互avilable
我失踪了?

+0

集view.userInteractionEnabled = YES;以你的看法。 –

+0

我试过serInteractionEnabled = YES它不工作 – user2047746

+0

目前你的_pickerView宽度=高度= 0.0所以设置宽度,你的_pickerView的高度现在它的工作.. –

回答

0

viewframe没有宽度或高度。很可能你的组件仍然出现,因为你的视图不会“剪辑子视图”。

您的代码:

[_pickerView setFrame:CGRectMake(0.0f, self.view.frame.size.height - _pickerView.frame.size.height , 0.0f, 0.0f)]; 
// 0.0f, 0.0f <-- width and height. 

的结果是,你可以看到的元素,但不与他们进行互动。当我认为我已经完成了这个任务时,我设置了我的视图的背景颜色,以便我可以在视觉上看到框架。

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];这条线是非常重要的:)

+0

不能工作 – user2047746