Subscribe ( )

iPhone Programming Tutorials


 

Forum

You must be logged in to post Login Register

Search 

Sliding a view using transitions

User Post

3:38 pm
November 20, 2008


colinhumber

Noob

colinhumber

posts 5

1

I am having issues with sliding a view in and out of the screen using CATransitions. I have no problem getting the view (it's like a bookmark) to slide onto the screen from the top. The problem I'm having is once the view is on the screen getting it to transition off of the screen.

This is the code I'm using to perform the slide on. The method getAnimationForDirection:type:duration: is just a helper method that returns a populated CATransition object. BookmarkView contains a single UIImageView and is a retained property on the view controller.

- (void)showBookmark
{
    bookmark = [[BookmarkView alloc] initWithFrame:CGRectMake(25, 0, 80, 250)];
    [swipeView addSubview:bookmark];
   
    CATransition *animation = [self getAnimationForDirection:kCATransitionFromBottom type:kCATransitionMoveIn duration:1.0];

    [[bookmark layer] addAnimation:animation forKey:@”BookmarkTransition”];
}


Search 

About the iCodeBlog forum

Most Users Ever Online:

44


Currently Online:

3 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 419

Posts: 893

Membership:

There are 934 Members

There has been 1 Guest

There are 2 Admins

There is 1 Moderator

Top Posters:

bobcubsfan – 54

crazyiez – 30

Uhu – 17

AdeC – 17

Nick – 15

jitesh61 – 12

Administrators: Brandon (88 Posts), Collin (0 Posts)

Moderators: VertigoSol (26 Posts)



©   

  • Posted by on 6 Aug 2008 in Uncategorized
  •   |  
  •   |  
  •   |  
  • Comments Off

Comments are closed.