1

I have tried to convert different view objects to make them resizable by calling the following code within my derived class:

[self setAutoresizingMask: NSViewHeightSizable|NSViewWidthSizable|NSViewMinXMargin|NSViewMaxXMargin|NSViewMinYMargin|NSViewMaxYMargin ];
NSView* sv = [self superview];
[sv setAutoresizesSubviews:YES];

However, this hasn't worked for the views that I have tried (NSImageView and PDFView). They do not resize when the parent window is resized. Is there something else that I need to call?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sam Manzer
  • 1,220
  • 10
  • 23
  • why are you doing this in code at all? use IB and autolayout. – Brad Allred Nov 18 '13 at 01:48
  • I haven't been able to locate an option in IB that got PDFView to resize correctly, so I tried to do it in code. I'll certainly accept an answer that describes how to do it in IB – Sam Manzer Nov 18 '13 at 01:50

1 Answers1

1

Please check out whether the answer posted for [question]:Cocoa PDFView does not resize
solved your problem.

Community
  • 1
  • 1