2010-09-08 38 views
1

我有uiview「DummyView」並將兩個其他視圖「StartView」和「ShowView」並排放入DummyView中。UIView翻譯後觸摸問題

當應用程序啓動時,StartView顯示出來。在這個視圖上是一個UIButton,它會觸發一個翻譯動畫,將StartView向左(屏幕外)和ShowView移動到屏幕中。在ShowView上,我有一個UIScrollView。

翻譯動畫後,我無法再滾動我的UIScrollView。在將StartView移出屏幕之前,它可以很好地工作(測試它)。

這是代碼。

- (void)viewDidLoad { 
    [super viewDidLoad]; 

    [button addTarget:self action:@selector(moveIt:) forControlEvents:UIControlEventTouchUpInside]; 
} 


- (void)moveIt:(id)sender { 
    NSLog(@"Move it!"); 

    [UIView beginAnimations:@"Move It" context:nil]; 
    [UIView setAnimationDuration:0.5]; 
    [UIView setAnimationBeginsFromCurrentState:YES]; 

    CGAffineTransform transform = CGAffineTransformMakeTranslation(-1024, 0); 
    self.view.superview.transform = transform; 

    [UIView setAnimationDelegate:self]; 
    [UIView commitAnimations]; 

} 

感謝您的建議。

回答

0

動畫後完成試:

self.view.superview.transform = CGAffineTransformIdentity; 

這應該有助於