NSTableView中的剪辑视图的永久错放视图警告 [英] Permanent Misplaced View warning for Clip View in NSTableView

查看:135
本文介绍了NSTableView中的剪辑视图的永久错放视图警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有一个日志窗口,显示NS​​TableView中的行:

My application has a log window that displays lines in an NSTableView:

窗口无论我做什么,我得到一个错位视图警告剪辑视图:

When I add auto layout constraints to the window no matter what I do I get a Misplaced View warning for the Clip View:

我已尝试更新其框架,更新其约束,并重置为建议的约束,但没有什么可以摆脱警告。窗口在运行时正确显示和调整大小,甚至看起来不可能向剪辑视图本身添加约束。

I've tried updating its frame, updating its constraints, and resetting to suggested constraints, but nothing gets rid of the warning. The window displays and resizes correctly at runtime, and it doesn't even appear to be possible to add constraints to the Clip View itself.

我已将代码推送到github如果你想看看它在Xcode: https://github.com/MagerValp/AutoDMG / tree / e57b0140e3fc3f7f9e0d4550341ed249a6cf5378 。代码需要10.10 SDK来编译,但xib应该在Xcode 5及以上版本中可见。

I've pushed the code to github if you want to look at it in Xcode: https://github.com/MagerValp/AutoDMG/tree/e57b0140e3fc3f7f9e0d4550341ed249a6cf5378. The code requires the 10.10 SDK to compile, but the xib should be viewable in Xcode 5 and up.

推荐答案

最近发出的警告,Clip视图期望值比实际值大17px。

I met the same issue recently, warning about Clip view expected value is 17px larger than actual value.

我相信这是Xcode的错误。我找到一个解决方法来解决它(除了将我的操作系统降级到10.9)。

I believe it is a bug of Xcode. And I do find a workaround to fix it(other than downgrading my OS to 10.9).

解决方案是在IB中编辑tableView的属性,禁用标题 。不要显示表头,警告会魔法消失。我们可以猜测,默认情况下,表头是17px:)

The solution is to edit the attributes of tableView in IB, disable "Headers". Don't show table headers and the warning will be magically gone. And we can guess that by default the table header is 17px :)

这只是一个解决方法,而不是一个理想的解决方案。这不是我们的错。最好的解决方法是等待苹果修复这个Xcode错误。

It's just a workaround, not an ideal solution. This is not our fault. The best solution is to wait for Apple to fix this Xcode bug.

这篇关于NSTableView中的剪辑视图的永久错放视图警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆