开发者

I want to add transition effect with every image of the slide show which i created so how i will add?

Here is few code related to my slide show,What i want is to add transition effect on each img.Img will be picked from library and add the transition effect on that img so when we play the slide the image with specific transition should be played means when 1 transition will disapear with their trans. effect another will appear with their transition effect..

   - (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 di开发者_StackOverflow社区smissModalViewControllerAnimated: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;

}


UIView has a class method by which you can transition from one view to another with a transition. Use it like this:

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

For more information refer to Apple's UIView documentation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜