2015-03-19 29 views
0

所以我有一个UITableViewUIViewController。如果没有的tableView,模拟器是这样的:

enter image description here

UITableView造成图像放大

然而,当表视图连接它看起来像这样:

enter image description here

与错误:

2015-03-19 02:08:56.086 CPX[55379:5813118] Warning: A long-running operation is being executed on the main thread. 
Break on warnBlockingOperationOnMainThread() to debug. 
2015-03-19 02:08:56.482 CPX[55379:5813118] Failed to set (autostart) user defined inspected property on (UIView): [<UIView 0x7f8fa8da28c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key autostart. 
2015-03-19 02:08:56.483 CPX[55379:5813118] Failed to set (animation) user defined inspected property on (UIView): [<UIView 0x7f8fa8da28c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key animation. 



为什么会发生这种情况,以及如何防止调整图像大小?

谢谢你的帮助!

+0

你在为tableview设置背景图片吗?或者它是你视图中的imageview背景图像? – 2015-03-19 07:15:07

+0

@UmangBista它是'UIViewController'上的'UIImageView'。 – StevenR 2015-03-19 07:15:55

+0

你在使用自动布局吗? – 2015-03-19 07:18:05

回答

0

我想你的自动调整大小或自动布局类在故事板或xib中引起问题,你可以简单地取消它并根据不同的iPhone尺寸处理框架。

+0

我在哪里可以取消选中它?我找不到在哪里。 – StevenR 2015-03-19 07:22:55

+0

@stevenR - 你的应用程序需要自动布局功能吗? – 2015-03-19 07:24:28

+0

@UmangBista我想我正在使用自动布局?我在哪里可以检查确定? – StevenR 2015-03-19 07:25:26

0

您可以使用自动布局约束来阻止调整图片的大小, 我建议只需在顶部和尾部空白处添加高度和宽度(如果图片的大小已固定),否则您必须根据相对视图添加约束条件,将不会根据另一个视图扩展高度和宽度的图像,然后添加相对于该视图的约束。

如果您可以显示您的其他视图,但我可以更具体地建议您必须添加哪些限制。