2013-04-01 56 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