setContent BorderThickness问题:对于Edge:实际上没有设置值

时间:2010-06-15 18:43:40

标签: cocoa nswindowcontroller

我正在尝试使用setContentBorderThickness:forEdge:在Cocoa应用程序中创建底栏。

mipadi正在做些什么,但在测试中,我认为这可能是一个稍微不同的问题:

-(void) adjustContentBorderBasedOnArrayControllerSelection{
    if(([[self.resultsArrayController selectionIndexes] count] == 0)){
        [[self window] setContentBorderThickness:40.0f forEdge:CGRectMinYEdge];
        NSLog(@"%f", [[self window] contentBorderThicknessForEdge:CGRectMinYEdge]);
    } else {
        [[self window] setContentBorderThickness:60.0f forEdge:CGRectMinYEdge];
        NSLog(@"%f", [[self window] contentBorderThicknessForEdge:CGRectMinYEdge]);
    }
}

即使在我明确设置之后,这两条NSLog()消息都显示厚度值为0.0。任何人都知道这是怎么回事?

2 个答案:

答案 0 :(得分:1)

您可以使用CGRectMinYEdge。 (在64位系统上,无论如何NSMinYEdge#defineCGRectMinYEdge

答案 1 :(得分:0)

你有没有检查确保[自我窗口]不是零?你的插座设置正确吗?如果未设置窗口的出口,我会得到这种行为。