如何在Cocoa应用程序中增加标题栏的高度?

时间:2011-08-08 13:20:39

标签: objective-c cocoa

我在Cocoa应用程序中设置了以下代码:

#import <Foundation/Foundation.h>
@interface uiview : NSObject {
    IBOutlet NSWindow *mainWindow;
    IBOutlet NSView *accessoryView;}


// Methods
- (void)composeInterface;
-(IBAction)button : (id)sender;
@end

#import "uiview.h"

@implementation uiview

- (void)awakeFromNib
{
    [self composeInterface];
    [mainWindow setTitleWithRepresentedFilename:@"/Users/parag/Documents/UIview"];
}
- (void)composeInterface
{
    NSView *themeFrame = [[mainWindow contentView] superview];
    NSRect c = [themeFrame frame];  
    NSRect aV = [accessoryView frame];
    NSRect newFrame = NSMakeRect(
                                 c.size.width - aV.size.width,   // x position
                                 c.size.height - aV.size.height, // y position NSPoint
                                 aV.size.width,  // width
                                 aV.size.height);        // height //NSSize
    [accessoryView setFrame:newFrame];
    [themeFrame addSubview:accessoryView];
}

如何增加窗口标题栏区域的高度,就像Mac App Store应用程序一样?

1 个答案:

答案 0 :(得分:2)

实际上,App Store应用没有标题栏。这可能是滥用Apple自己的用户界面指南。所以不要模仿它们。