iPhone - Retrancher un NSString [double]
-
01-10-2019 - |
Question
Cette question a déjà une réponse ici:
- La meilleure façon de trouver un texte 2 réponses
Je voudrais savoir s'il y a un moyen facile de grève / biffer du texte sur l'iPhone?
Merci
La solution
Oui et Non,
NSString est une classe simple, que seuls les magasins texte non formaté, mais vous pouvez utiliser un NSAttributedString pour stocker ces informations, i.e..
NSAttributedString* italicText = [[NSAttributedString alloc] initWithString:myNsString attributes:myCrossOutAttributes];
Autres conseils
NSMutableAttributedString *strikeThroughString = [[NSMutableAttributedString alloc] initWithString:anyString];
[strikeThroughString addAttribute:NSStrikethroughStyleAttributeName value:(NSNumber *)kCFBooleanTrue range:NSMakeRange(0, [as length])];
[m_cObjTaskTitle setAttributedText:strikeThroughString =];
cObjTaskTitle = UILabel ;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow