NSSplitView and autolayout

后端 未结 9 2018
暗喜
暗喜 2021-02-02 10:55

How should I use auto layout constrains inside NSSplitView subview?

My NSSplitView subview has 3 subview: topPane, tableCont

9条回答
  •  旧巷少年郎
    2021-02-02 11:33

    I used this class as a workaround, it's not perfect (the subviews stutter a bit) but it unblocked me. I use this class as the custom class inside each split view pane.

    @interface FBSplitPaneView : NSView
    
    @end
    
    @implementation FBSplitPaneView
    
    - (void)setFrame:(NSRect)frame
    {
      for (NSView *subview in self.subviews) {
        subview.frame = self.bounds;
      }
      [super setFrame:frame];
    }
    
    @end
    

提交回复
热议问题