Resizing weirdness in custom View with isFlipped YES

127 Views Asked by At

I'm having a hard time getting my subview to behave properly.

I am using auto-layout. My main window is an NSSplitView. One of the views in the split view is a custom view, where I set

-(BOOL)isFlipped
{
    return YES;
}

An added subview in this view is displayed at the top left. The subview is a lot smaller than the superview, so there is some space left over at the bottom. The problems start when I resize the window (and thus the superview). The subview moves up, out of view, like below. First picture shows the top of the subview nicely aligned at the top of the superview:

enter image description here

After resizing the window, I get this at the top:

enter image description here

This should not happen; if anything, the subview should be clipped at the bottom. The top-left of the subview should always stay at the top-left of the superview.

I am sure I made an error somewhere -- does someone recognize this behavior? I am afraid I messed things up a while ago and have no idea where to look. Any help appreciated!

1

There are 1 best solutions below

0
On

Problem solved after turning "translates mask into constraints" off for the subview: enter image description here