I'm trying to create a little Finder clone using Cocoa. I'm placing a source list table view (to act as a sidebar) and a standard table view inside of an NSSplitView
controlled by an NSSplitViewController
.
Unfortunately, when I run this, the standard table view's white background is drawn over the bottom right corner of the window, resulting in a non-rounded corner:
我可以通过不使用来避免这个问题NSSplitViewController
,都使用标准 nib 文件或故事板来获得所需的结果:
但是……我真的很想用NSSplitViewController
。有什么办法可以防止这种情况发生吗?
这是包含项目的 Xcode 工作区 https://www.dropbox.com/s/ow6clm52zu6ouzd/NSSplitViewController%20Stack%20Overflow.zip?dl=1对于屏幕截图。
我见过这样的问题,它似乎是真正的错误。但有一个解决方法。您需要确保 NSSplitViewController 在 CA 层支持的视图中呈现自身。因此,为了在您的项目中执行此操作,我添加了带有容器视图的中间人视图控制器。然后我将您的分割视图放置在该容器视图中。最后,容器视图的父视图被设置为图层支持。这是图片:
之后我可以看到一切都很好:
另请注意:确保在真正需要之前不要使用 1000 优先级约束。我通常使用 750(我也修复了这个问题)。否则你会收到很多关于不满意的事情的警告。
这是你固定的项目:https://github.com/emankovski/splitviewroundcorners https://github.com/emankovski/splitviewroundcorrners
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)