macOS/iOS API解説

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

目次

setDrawsBackground:

テキストビューが背景を描画するかセットします
-(void)setDrawsBackground:(BOOL)flag:

解説

テキストビューが背景を描画するかセットします
flagがYESなら背景は背景色で塗ります。
flagはNOなら背景は塗りません。

返り値

( void )

なし

引数

( BOOL )flag

YES/NO

フレームワーク

ApplicationKit

クラス

NSTextView

Instance Methods

使用可能

10.0

参照

- setBackgroundColor:
- drawsBackground

例文

NSColor *theColor = [NSColor colorWithDeviceRed:1 green:0.3 blue:0.8 alpha:1];//カラー作成
[myOutlet setDrawsBackground:NO];
[myOutlet setBackgroundColor:theColor];
[myOutlet insertText:[NSString stringWithFormat:@"RedValue=%.1f",[[myOutlet backgroundColor] redComponent]]];