animate image into parent view

Discussion in 'iOS Programming' started by brownsocks, Aug 16, 2008.

  1. brownsocks macrumors newbie

    Jul 28, 2008
    I am hoping someone can help with an issue I am having. I have a custom UIView that is placed on the screen. When a button is pushed I would like the image to scroll into view within the bounds of the custom view. I am currently using the below code to slide the image view containing the image down, however the image is not being clipped to within the bounds of the parent view. How can i accomplish this?

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:5];
    [UIView setAnimationDelegate:self];
    CGAffineTransform transform = CGAffineTransformMakeTranslation(0, 160);
    currentImage.transform = transform;
    [UIView commitAnimations];
    Any help would be greatly appreciated.
  2. gralem macrumors member

    Mar 25, 2002

    parentView.clipsToBounds = YES;
    Do you use read the API documentation?
  3. brownsocks thread starter macrumors newbie

    Jul 28, 2008
    thanks for the response, i read through the api but somehow missed that property, thanks for the clarification.

Share This Page