Problem
Had a number of UITextView controls on my Xamarin/C# screen. Customer asked for one of them to be underlined. I was unsure of how to accomplish this.
Solution
Fortunately, Guillermo over at Xamarin Forums had a similar solution for UILabel. Here is my reworked solution.
UITextView aboutTextView = new UITextView(new RectangleF(30,225,280,80));
aboutTextView.TextColor = UIColor.Black;
var attrString = new NSAttributedString("The Text",
underlineStyle: NSUnderlineStyle.Single);
aboutTextView.AttributedText = attrString;
aboutTextView.Font = UIFont.SystemFontOfSize(14.0f);
Add(aboutTextView);
Source:
http://forums.xamarin.com/discussion/11584/how-to-add-strikeout-strikethrough-to-an-uilabel
No comments:
Post a Comment