RichTextKit
RichTextKit copied to clipboard
TextColor of RichString method does not work after construction
This works:
var rs = new RichString().Add("Hello world", textColor: SKColors.Red);
This does not and text is still black. Am I missing anything?
var rs = new RichString().Add("Hello world");
rs.TextColor(SKColors.Green);
Set the text color first. Basically you do the setup for the text first then add the text after the setup is done:
var rs = new RichString().TextColor(SKColors.Green);
rs.Add("Hello world");
The reply from @gbreen12 is correct. The RichString fluent API uses methods to set attributes for subsequently added text - not the text already added.