Custom View NSVIew Does Not Resize

I'm new to Mac programming, using the whole standard approach, I put a custom view in a window controller. When I try to resize the window with the mouse, the internal content i.e. Custom view does not change.

Can someone tell me what is missing in my code? So far I have been doing the following:

  • Customizing AutoResize routines in all views inside a window
  • Set AutoResizeMask to Width and Height

When I checked with NSLog in the reference code where the resizing takes place, I found out that my DrawRect code does not receive for viewing. I suspect that this may be a problem, but why it does not work, I can not understand it.

+4
source share
1 answer

What does your code look like

[yourCustomView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; 
+4
source

Source: https://habr.com/ru/post/1334927/


All Articles