Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextView not saving markedTextStyle (UITextInput protocol)

Marking text in a UITextView, but for some reason it's refusing to accept anything I give it with setMarkedTextStyle. -markedTextStyle always returns nil, and the marked text always looks the same (blue background and maintains text color).

[_taggedUsersView setMarkedTextStyle:@{UITextInputTextColorKey: [UIColor whiteColor], UITextInputTextBackgroundColorKey: [UIColor tranceLinkBlue], UITextInputTextFontKey: [UIFont fontWithName:@"HelveticaNeue-Medium" size:14.0]}];

Tried doing this both when I create the textview, right before marking text and right after. But it still maintains the default style, and returns nil for the style.

like image 421
Christian A. Strømmen Avatar asked Jul 26 '14 22:07

Christian A. Strømmen


1 Answers

After a lot of testing the only thing I can say is that it is a bug in the SDK. Setting markedTextStyle property has no effect and getter returns always nil.

This comes against what we can read in documentation:

markedTextStyle

A dictionary of attributes that describes how marked text should be drawn.

I reported it to Apple as a bug (Bug ID - 17914881).

like image 164
Rafa de King Avatar answered Nov 15 '22 10:11

Rafa de King