简体   繁体   English

无法更改UITableViewCell内部的UIImageView的宽度和高度-Swift

[英]Unable to change the width and height of UIImageView inside a UITableViewCell - swift

I have the following layout for my UIViewController that also has a UITableView. 我的UIViewController具有以下布局,其中也具有UITableView。 I have tried to change the width and height of the UIImageView inside the UITableViewCell without success. 我试图在UITableViewCell内更改UIImageView的宽度和高度,但没有成功。 I have been using the storyboard to change the width and height without any success. 我一直在使用情节提要板来更改宽度和高度,但没有成功。 The image size remains the same size whether I try to increase or decrease any of the dimensions (as in when i install the app or it on the simulator - the size of the image is always the same) 无论我尝试增大还是减小任何尺寸,图像尺寸都保持不变(例如,当我在模拟器上安装应用程序或将其安装在模拟器上时,图像尺寸始终相同)

layout: 布局:

在此处输入图片说明

Looks Like this: 看起来像这样:

在此处输入图片说明

Constraints for UIImageView: UIImageView的约束:

在此处输入图片说明

width: 宽度:

在此处输入图片说明

Height: 高度:

在此处输入图片说明

You need to click the width and height constraints and change their constants values in your example change from 20 to anything , but from size inspector or by dragging a side of the imageView you won't get anything as you can't have both auto-layout and frame at the same time 您需要单击宽度和高度约束,并在示例中将其常数值从20更改为任何值,但是从大小检查器或拖动imageView的一侧将无法获得任何内容,因为您无法同时使用自动同时布局和框架

在此处输入图片说明

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

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