如何在Cocoa应用程序中增加标题栏的高度? [英] How do I increase the height of the title bar in a Cocoa application?

查看:126
本文介绍了如何在Cocoa应用程序中增加标题栏的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码在Cocoa应用程序中设置我的界面:

I have the following code for setting up my interface in a Cocoa application:

#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];
}

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

How can I increase the height of the window's title bar area, like the Mac App Store application does?

推荐答案

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

Actually, the App Store app has no title bar. This is probably an abuse of Apple's own user interface guidelines. So don't emulate them.

这篇关于如何在Cocoa应用程序中增加标题栏的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆