如何增加 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 应用程序那样?
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];
}
How can I increase the height of the window's title bar area, like the Mac App Store application does?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,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.