2
Je suis en train de définir la couleur de la police et sa ne fonctionne pas pour une raison quelconquefont color chaîne Attribuée ne fonctionne pas
public void ConvertToLinkButton(UIButton btn, String hyperlink)
{
CTStringAttributes attributesHyperLink = new CTStringAttributes();
attributesHyperLink.UnderlineStyle = CTUnderlineStyle.Single;
attributesHyperLink.ForegroundColor = UIColor.Purple.CGColor;
NSMutableAttributedString attrString = new NSMutableAttributedString(btn.TitleLabel.Text);
attrString.AddAttributes(attributesHyperLink, new NSRange(btn.TitleLabel.Text.IndexOf(hyperlink), hyperlink.Length));
btn.TitleLabel.AttributedText = attrString;
}
Je me demande pourquoi est-il passe?
Merci, mais pourquoi cela ne fonctionne-t-il pas? –
@ DuraiAmuthan.H Honnêtement, je ne suis pas sûr. Cependant, CoreText est une technologie de bas niveau qui convient mieux aux cas où vous avez vraiment besoin de fonctionnalités de traitement de texte de bas niveau. UIStringAttributes de UIKit fournit tout ce dont vous avez besoin ici et c'est ce que j'ai utilisé auparavant. – hankide