Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

brownsocks

macrumors newbie
Original poster
Jul 28, 2008
4
0
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?

Code:
[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.
 

gralem

macrumors member
Mar 25, 2002
48
0
Umm...

Code:
parentView.clipsToBounds = YES;

Do you use read the API documentation?
 

brownsocks

macrumors newbie
Original poster
Jul 28, 2008
4
0
thanks for the response, i read through the api but somehow missed that property, thanks for the clarification.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.