简体   繁体   English

iOS图像约束在设备中无法正常工作

[英]IOS Image Constraints not working properly in devices

I am new to IOS and learning to work with Constraints, I basically have a TableView and an Image that I want to take up the full width of the TableView. 我是IOS的新手,正在学习使用约束的方法,基本上我有一个TableView和一个Image,我想占用TableView的整个宽度。 The Image works correctly in IOS 6s but not in IOS 7 plus emulator . 该映像在IOS 6s中正常运行,但在IOS 7 plus仿真器中无法正常运行。 How can I make my constraint work ? 如何使约束生效? The image is set to scale to fill and this is how it looks . 图像设置为缩放以填充,这就是它的外观。 As stated before with the Constraints I am trying to get the iPhone 7 plus emulator to show the image just like the iPhone 6s . 如前所述,我试图让iPhone 7 plus模拟器像iPhone 6s一样显示图像。 My current understanding is that when you set Trailing and Leading to each other then the image is supposed to take up the full width of the TableView . 我目前的理解是,当您将“ Trailing”和“ Leading”设置为“彼此”时,图像应该占据TableView的整个宽度。

在此处输入图片说明

在此处输入图片说明

在此处输入图片说明 在此处输入图片说明

It looks like your table isn't constrained on each side. 看起来您的桌子并没有被约束在每一侧。 If you look at the line between the cells on the 7 plus it doesn't go to the right edge of the screen, but it does on the 6s. 如果您查看7 plus上的单元格之间的线,它不会到达屏幕的右边缘,但是会出现在6s上。 Meaning it's probably the table itself that isn't constrained. 意味着不受约束的可能是表本身。

可能是因为您没有为表格视图设置正确的约束,或者已通过代码更改了表格视图的框架。

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

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