private void SetText(UILabel label, UIFont font, RoubleType type) { char roubleSym = Roubles.GetRoubleSymbFor (type); NSMutableAttributedString attrString = new NSMutableAttributedString(); attrString.Append(new NSAttributedString(Text, font: font, foregroundColor: UIColor.Black)); attrString.Append(new NSAttributedString(roubleSym.ToString(), font: _roubleFont, foregroundColor: UIColor.Black)); label.AttributedText = attrString; }
public static void SetTextWithRouble(this TextView label, string text, RoubleType roubleType) { var textFormatted = new SpannableString(text + Roubles.GetRoubleSymbFor(roubleType)); textFormatted.SetSpan(RoubleSpan, textFormatted.Length() - 1, textFormatted.Length(), SpanTypes.ExclusiveExclusive); label.TextFormatted = textFormatted; }
public static char GetRoubleSymbFor(RoubleType type) { return _roubleSymbols[type]; }