2017-04-20 15 views
0

这是我通过XIB创建的细胞:当我点击单元格,形象伸出

enter image description here

但然而,当我使用的tableView加载细胞,我得到的问题:

enter image description here

+0

删除现有的底部约束...给底部约束与标签。 – KKRocks

+0

set imageview.cliptoBound = yes; – ajjjjjjjj

+0

只需设置imageview缩小以适合您的问题解决 –

回答

0

您需要更改如下图像比例:

imageView.contentMode = UIViewContentModeScaleAspectFit; 

斯威夫特3

imageView.contentMode = .scaleAspectFit 
0

这是因为你在属性潘内尔使用Aspect Fill。因此,图像的宽度等于屏幕(根据您的约束)并保持其宽度*高度比率,但是它超出了您的界限imageView

您需要在viewDidLoad或在类文件中加入:

imageView.clipsToBounds = true

检查此链接到Apple's documentations

0

你需要剪辑出来的图像侧边界:

imageView.clipsToBounds = YES 

它将裁剪图像到可见矩形只有

0

如果哟ü设计你的细胞在厦门国际银行,您可以设置剪辑到边界在图纸:

相关问题