I have a UIView with a UIImageView inside larger. Is there a way to hide what lies beyond the size of the view?
CGRect baseFrame = CGRectMake(1开发者_如何学Go00, 100, 300, 80);
UIView *baseView = [[UIView alloc] initWithFrame:baseFrame];
[self.view addSubview:baseView];
[baseView release];
UIImageView *baseBg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 300, 335)];
[baseBg setImage: [UIImage imageNamed:[NSString stringWithFormat:@"baseView.png"]]];
[baseView addSubview: baseBg];
[baseBg release];
thanks a lot!
UIView.clipsToBounds = YES
UIView Class Reference
精彩评论