How to increase the height of NSTableHeaderView?

后端 未结 3 900
天涯浪人
天涯浪人 2021-02-04 22:19

I need to implement a headerview with specific size and gradient. I have to insert images in certain cells of the headerview.Tried to create the cells

3条回答
  •  耶瑟儿~
    2021-02-04 22:46

    Following link helped me in solving the issue.

    http://lists.apple.com/archives/cocoa-dev/2003/Feb/msg00676.html

    You need to set the Frame for NSClipView, NSTableHeaderView and the CornerView This is how I implemented the same in Code.

    for(NSView * subview in [topScrollView subviews])
    {           
       for(NSView * subSubView in [subview subviews])
       {
          if([[subSubView  className] isEqualToString:@"NSTableHeaderView"] &&  [[subview className] isEqualToString:@"NSClipView"]) 
          {
             [subSubView setFrameSize:NSMakeSize(subSubView.frame.size.width, subSubView.frame.size.height+5)];//HeaderView Frame
             [subview setFrameSize:NSMakeSize(subview.frame.size.width, subview.frame.size.height+5)];//ClipView Frame
          }
    
        }
        if ([[subview className] isEqualToString:@"_NSCornerView"])
        {
           [subview setFrameSize:NSMakeSize(subview.frame.size.width, subview.frame.size.height+5)]; //CornerView Frame
        }
    }
    

提交回复
热议问题