macOS/iOS API解説

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

目次

setVerticallyCentered:

天地方向の中心に置くかをセットします
-(void)setVerticallyCentered:(BOOL)flag:

解説

天地方向の中心に置くかをセットします
flagがYESなら、画像は天地の中心におかれます。

返り値

( void )

なし

引数

( BOOL )flag

YES/NO

フレームワーク

ApplicationKit

クラス

NSPrintInfo

Instance Methods

使用可能

10.0

参照

- isHorizontallyCentered
- isVerticallyCentered
- setHorizontallyCentered:

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSPrintInfo *pInfo = [NSPrintInfo sharedPrintInfo] ;
NSPageLayout *pageLayout = [NSPageLayout pageLayout];

[pInfo setVerticallyCentered:YES];

[pageLayout beginSheetWithPrintInfo:pInfo
            modalForWindow:[sender window] 
            delegate:self 
            didEndSelector:@selector(didEndPageLayout) 
            contextInfo:nil ];
            
            if ([pInfo isVerticallyCentered])
            {
                NSLog(@"YES");
            }else{
                NSLog(@"NO");
            }
}
-(void)didEndPageLayout
{
NSLog(@"close");
}

@end