开发者

UIView with a UIImageView inside larger

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜