Adding subview to view with a PDFView as a subview
I have a controller view. This controller has a PDFView as a subview and another subview which is like a cont开发者_开发问答roller to the pdf.
The problem is that if I do the following in the controller:
self.view addSubview:pdfView];
[self.view addSubview:pdfController];
The pdfController lays on the pdfView, but it will scroll with the pdf if you scroll it. I want to make pdfController view to be immobile and to just sit on the pdfView. Does anyone know how to get this behavior?
I remember having similar trouble trying to overlay an NSView
over a PDFView
with an app I was writing a few years ago. Assuming you've tried messing with the NSScrollView's
copyOnScroll
and the various autoresizing options, a good solution is to put the controller view in a separate child window that overlays the window your PDFView
is in. You'll need to do a little work to synchronize behavior between the two windows, but in the end you won't have any of the weird problems that happen when you try to overlap sibling views like that.
精彩评论