How to change marked text format of the IMKTextInput?

226 Views Asked by At

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 with 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

There are 0 best solutions below