macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

trailingOffset

INDEX>AppKit>NSDrawer

引き出しが表示される下(右)からのオフセット値を返します

Objective-C

@property CGFloat trailingOffset

Swift

var trailingOffset: CGFloat

解説

引き出しが表示される下(右)からのオフセット値を返します。

設定値

長さ
Objective-C

@property CGFloat trailingOffset

Swift

var trailingOffset: CGFloat

フレームワーク

ApplicationKit

クラス

NSDrawer

使用可能

10.0

参照

cocoaapi.hatenablog.com

更新時のバージョン

OS X 10.10.2

関連記事(外部サイト)

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction1:(id)sender
{
[drawer open];
[drawer setTrailingOffset:50.0];
NSLog([NSString stringWithFormat:@"leadingOffset=%.1f",[drawer trailingOffset]]);
}

- (IBAction)myAction2:(id)sender
{
[drawer close];
}

@end

Swift

    //NSDrawer contentSize
    //NSDrawer leadingOffset
    //NSDrawer maxContentSize
    //NSDrawer minContentSize
    //NSDrawer trailingOffset
    var theDrawer006 : NSDrawer = NSDrawer(contentSize: NSMakeSize(100.0, 100.0),
        preferredEdge: 1 )
    //preferredEdge 0=左、1=下、2=右、3=上
    func buttonAction006(sender: AnyObject){
        
        var theWindow : NSWindow = (sender as NSButton).window!

        //drawerを表示/非表示
        theDrawer006.toggle(theWindow)
        
        NSLog("size = (%.2f,%.2f)", Float(theDrawer006.contentSize.width),Float(theDrawer006.contentSize.height))
        
        NSLog("leadingOffset = (%.2f)", Float(theDrawer006.leadingOffset))
       
        NSLog("maxContentSize = (%.2f,%.2f)", Float(theDrawer006.maxContentSize.width),Float(theDrawer006.maxContentSize.height))
        NSLog("minContentSize = (%.2f,%.2f)", Float(theDrawer006.minContentSize.width),Float(theDrawer006.minContentSize.height))
        NSLog("trailingOffset = (%.2f)", Float(theDrawer006.trailingOffset))
        
        
    
    }