代理方法
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex
{
NSLog(@"Victor log 3");
return 40*(dividerIndex+1);
}
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex
{
NSLog(@"Victor log 5");
return 300*(dividerIndex+1);
}
这两个代理方法设置了拖动时最大和最小坐标,往小拖动时,效果见下图,注意到40位置和300位置时的闪变