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”];
}



About the iCodeBlog forum

Currently Online:

3 Guests

Maximum Online: 25

Forums:

Groups: 2

Forums: 6

Topics: 215

Posts: 618

Members:

There are 435 members

There are 1 guests


Brandon has made 87 posts

Top Posters:

bobcubsfan - 52

crazyiez - 30

VertigoSol - 26

Uhu - 17

AdeC - 17

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)