简体   繁体   English

iOS在表格视图单元格中视觉调整图像大小

[英]ios visually resize image in a table view cell

I am new to ios and am working on creating a table view with custom table view cell. 我是ios的新手,正在使用自定义表格视图单元格创建表格视图。 I am running into a very simple problem. 我遇到了一个非常简单的问题。 I am trying to resize an image visually within a custom table view cell (the table view cell content outlets are linked to a custom class). 我试图在自定义表格视图单元格中直观地调整图像大小(表格视图单元格内容出口链接到自定义类)。 However, I am unable to resize either the labels or the image. 但是,我无法调整标签或图像的大小。 Following screen shot is that of my storyboard view and the image. 屏幕截图之后是我的情节提要视图和图像。 Any ideas if I am missing something? 有什么想法我想念什么吗? Thanks! 谢谢!

在此处输入图片说明

You need to put the name of your custom class on Class property of TableViewCell like the image. 您需要将自定义类的名称像图片一样放在TableViewCell的Class属性上。 If it does not work, let we know more about the code. 如果它不起作用,请让我们进一步了解该代码。

Is this a Static Cell? 这是静态细胞吗? If you have a UIImageView in your custom cell then you should be able to load the image and IOS will automatically size your image. 如果您的自定义单元格中有UIImageView,则应该能够加载图像,并且IOS将自动调整图像大小。

This may be a bug in my Xcode Version 5.0 (5A11365x. When I switch to Xcode 4.5.2, I am able to resize the labels. I am developing for ios 7.0. I will download the latest Xcode for ios 7 and see if that fixes the issue. 这可能是我的Xcode版本5.0(5A11365x)中的错误。当我切换到Xcode 4.5.2时,我能够调整标签的大小。我正在为ios 7.0开发。我将下载最新的ios 7的Xcode,看看是否解决此问题。

UPDATE Yes looks like it is an Xcode bug. 更新是,看起来像是Xcode错误。 I just installed latest Xcode Version 5.0 (5A1412) and it allows you to adjust the label and image sizes. 我刚刚安装了最新的Xcode版本5.0(5A1412),它允许您调整标签和图像大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM