xcode 在表格单元格iphone中调整图像视图的大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1580705/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:54:27 来源:igfitidea点击:
Resizing image view in table cell iphone
提问by Iya
I am developing an iPhone app where downloading a high quality image from my app server. I am required to resize it to half its size and display it in the table cell. Could anyone help me to find which functions I could use?
我正在开发一个 iPhone 应用程序,从我的应用程序服务器下载高质量的图像。我需要将其大小调整为其一半大小并在表格单元格中显示它。谁能帮我找到我可以使用哪些功能?
Appreciate your suggestions!
感谢您的建议!
回答by Brad The App Guy
UIImage *yourImage = [UIImage imageWithData:yourdata];
UIImageView *imageViewToPutInCell = [[UIImageView alloc] initWithImage:yourImage];
imageViewToPutInCell.frame = CGRectMake(0, 0, yourImage.size.width / 2, yourImage.size.height / 2);