UIView 里面有一个 UIImageView 更大
我有一个 UIView,里面有一个更大的 UIImageView。有没有办法隐藏视图大小之外的内容?
CGRect baseFrame = CGRectMake(100, 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];
多谢!
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(100, 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UIView 类参考
UIView Class Reference