NSView -scaleUnitSquareToSize 将视图保留为空白,直到调整大小为止,尽管 -setNeedsDisplay 消息
我使用了这个指南: http://developer.apple.com/mac /library/qa/qa2004/qa1346.html 在特殊视图中实现缩放。缩放视图是 NSScrollView 的文档视图。问题是,当我调用 -scaleUnitSquareToSize,然后调用 -setNeedsDisplay:YES (我还在滚动视图上尝试了 -setNeedsDisplay:YES)时,视图(不是滚动条,只是里面的所有内容)变成空白。如果我调整包含视图的窗口的大小,其内容将重新出现并正确显示。但一旦我重新缩放并重新绘制,它就会再次空白。关于如何强制视图正确刷新有什么想法吗?
另外,很抱歉没有提供源代码,但该代码是商业机密,所以......
I used this guide: http://developer.apple.com/mac/library/qa/qa2004/qa1346.html to implement scaling in a special view. The scaled view is the document view of an NSScrollView. The problem is that when I call -scaleUnitSquareToSize, then call -setNeedsDisplay:YES (I also tried -setNeedsDisplay:YES on the scroll view), the view (not the scroll bars, just everything inside) becomes blank. If I resize the window that contains the view, its contents reappear and display properly. But as soon as I rescale and redraw, it blanks out again. Any ideas on how to force the view to refresh properly?
Also, sorry for not providing source code, but the code is trade secret, so...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来剪辑视图没有更新以处理内容视图的规模。尝试记录文档视图、剪辑视图和内容视图的框架和边界。
sounds like the clipview's not getting updated to deal with the scale of your contentview. Try logging the documentview, clipview, and contentview's frame and bounds.