2011-08-16 69 views
0

這裏是幾個與我的幻燈片相關的代碼,我想要的是在每個img上添加過渡效果.Img將從庫中挑選並在該img上添加過渡效果,因此當我們播放幻燈片時,具有特定過渡的圖像應該被髮揮意味着1轉換將消失與他們的反式。另一個影響將他們的過渡效果出現..我想添加幻燈片放映的所有圖像的過渡效果,我將如何添加?

- (void)addPhoto 
{ 
if (imagePicker == nil) 
{ 

    imagePicker = [[UIImagePickerController alloc] init]; 
    imagePicker.allowsImageEditing = YES; 

    imagePicker.sourceType = 
    UIImagePickerControllerSourceTypePhotoLibrary; 
    imagePicker.delegate = self; 
} 

returnFromImagePicker = YES; 


[self presentModalViewController:imagePicker animated:YES]; 
} 


- (void)imagePickerController:(UIImagePickerController *)picker 
didFinishPickingImage:(UIImage *)img editingInfo: 
(NSDictionary *)editInfo 
{ 
[pictures addObject:img]; 

UITableView *table = (UITableView *)self.view; 


    [table insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath 
    indexPathForRow:pictures.count - 1 inSection:0]] withRowAnimation: 
    UITableViewRowAnimationRight]; 


[self dismissModalViewControllerAnimated:YES]; 
} 


- (void)addEffect 
{ 
if (effectSheet == nil) 
{ 

    effectSheet = [[UIActionSheet alloc] initWithTitle:@"Choose Effect" 
    delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil 
    otherButtonTitles:@"Fade", @"Slide In", nil]; 
} 

[effectSheet showInView:self.view]; 
} 


- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex: 
(NSInteger)buttonIndex 
{ 
effect = buttonIndex; 

} 
+0

您能否介紹一些更詳細的信息和一些您正在使用的代碼來應用過渡效果。 –

+0

@Dev Singh請問清楚,你想要什麼? –

+0

我修改了qu –

回答

0

的UIView有一個類的方法,通過它可以從一個視圖與過渡過渡到另一個。使用這樣的:

[UIView transitionFromView:currentView toView:newView duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft completion:nil]; 

欲瞭解更多信息,請參閱Apple's UIView documentation

相關問題