macOS/iOS API解説

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

目次

backgroundColor

テキストビューの背景色を返します

解説

テキストビューの背景色を返します。

返り値

( NSColor * )

背景色

引数

フレームワーク

ApplicationKit

クラス

NSTextView

Instance Methods

使用可能

10.0

参照

- drawsBackground
- setBackgroundColor:

例文

NSColor *theColor = [NSColor colorWithDeviceRed:1 green:0.3 blue:0.8 alpha:1];//カラー作成

[myOutlet setBackgroundColor:theColor];
[myOutlet insertText:[NSString stringWithFormat:@"RedValue=%.1f",[[myOutlet backgroundColor] redComponent]]];