macOS/iOS API解説

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

目次

setSelectedTextAttributes:

選択する文字の属性をセットします
-(void)setSelectedTextAttributes:(NSDictionary *)attributes:

解説

選択している文字の属性をセットします。
描画色、背景色、アンダーラインがサポートする属性です。

返り値

( void )

なし

引数

( NSDictionary * )attributes

文字属性

フレームワーク

ApplicationKit

クラス

NSTextView

Instance Methods

使用可能

10.0

参照

- selectedRange (NSTextInput)
- selectedTextAttributes

例文

[textView setSelectedTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSColor selectedControlTextColor], NSForegroundColorAttributeName, [NSColor selectedTextBackgroundColor], NSBackgroundColorAttributeName, nil]];