How to cross out a string $127.95 in middle. Is there any simple method used to Strike ?
Asked
Active
Viewed 220 times
2
3 Answers
2
As of iOS6 you can use NSAttributedString
:
NSDictionary *attributes = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlinePatternSolid | NSUnderlineStyleSingle]};
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:@"$127.95" attributes:attributes];

tilo
- 14,009
- 6
- 68
- 85
1
Please have a look at this answer:
CoreText and strikethrough on iPhone
It suggests using Core Text as described here:
http://www.cocoanetics.com/2011/01/befriending-core-text/
Note: this is iOS6 only.
1
Use https://github.com/mattt/TTTAttributedLabel for dropped in UILabel
replacement, it does all the Core Text heavy lifting pretty well.

overboming
- 1,502
- 1
- 18
- 36
Thanks. – Manann Sseth Jan 28 '13 at 12:25