以下是我的代碼,用於在子視圖上添加表格時顯示淡入淡出效果。問題是代碼第一次工作。添加表後,當我點擊關閉時,子視圖按鈕表被刪除。但是,當我按下按鈕,以再次子視圖表添加淡入淡出效果不做工精細重複淡入淡出效果不起作用
double delayInSeconds2 = 0.1;
dispatch_time_t popTime2 = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds2 * NSEC_PER_SEC));
dispatch_after(popTime2, dispatch_get_main_queue(), ^(void){
self.otlTableRightView.frame=CGRectMake(100, 68, 300, 378);
[self.otlTableRightView setAlpha:0.0];
[self.otlRightFromView addSubview:self.otlTableRightView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.2];
self.otlTableRightView.frame=CGRectMake(43, 68, 300, 378);
[UIView commitAnimations];
[UIView animateWithDuration:2.0 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
[self.otlTableRightView setAlpha:0.0];
}completion:^(BOOL done){
}];
});
,我使用
從我的子畫面刪除我的表
UIViewAnimationOptionCurveEaseInOut不能正常工作,但其他兩個選項 – Jasmeet