开发者

How to change marked text format of the IMKTextInput?

By default implementors of the IMKTextInput protocol displays marked text of the current input session underlined (with 2 pixel black underline according to documentation). I develop specific Input Method and would like to use another formatting, say, without underlining but wi开发者_如何学JAVAth background color. I've tried attributed string with empty format:

NSString *buffer = /* getting some buffered text */;
NSMutableAttributedString *text = [[[NSMutableAttributedString alloc] initWithString:buffer attributes:[NSDictionary dictionary]] autorelease];
// client is of type id<IMKTextInput>, of course
[client setMarkedText:text selectionRange:NSMakeRange(0, [text length]) replacementRange:NSMakeRange(NSNotFound, NSNotFound)];

but with no avail. So, how can I change format of marked text? Is it possible?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜