macOS/iOS API解説

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

目次

imagePosition

タイトルと画像の位置関係を返します

解説

タイトルと画像の位置関係を返します。
【NSCellImagePosition】
● NSNoImage
● NSImageOnly
● NSImageLeft
● NSImageRight
● NSImageBelow
● NSImageAbove
● NSImageOverlaps

返り値

( NSCellImagePosition )

イメージの位置

引数

フレームワーク

ApplicationKit

クラス

NSButtonCell

Instance Methods

使用可能

10.0

参照

- setButtonType:
- setTitle:
- setImage:(NSCell)

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
switch ([bCell1 imagePosition]){
        case NSNoImage:
            NSLog(@"NSNoImage");
            break;
        case NSImageOnly:
            NSLog(@"NSImageOnly");
            break;
        case NSImageLeft:
            NSLog(@"NSImageLeft");
            break;
        case NSImageRight:
            NSLog(@"NSImageRight");
            break;
        case NSImageBelow:
            NSLog(@"NSImageBelow");
            break;
        case NSImageAbove:
            NSLog(@"NSImageAbove");
            break;
        case NSImageOverlaps:
            NSLog(@"NSImageOverlaps");
            break;
        default :
            NSLog(@"other");
        }
}

@end