Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAMARIN (C#) - Is There A Way To Underline A TextView Programmatically?

I know there are some other ways to do it (I think in Java you do something like this .SetPaintFlags(Paint.Underline_Text_Flag);) - and I do understand that it could be sort of emulated using the Draw Line and there is also a way to do it by predefining it in xml file as well.

The question is how to accomplish it **programmatically in Xamarin (C#)? There should be a property on the object or some way to set it**

like image 304
Alexey Shevelyov Avatar asked Feb 12 '15 19:02

Alexey Shevelyov


People also ask

Does Xamarin use C#?

Xamarin is an open source app platform from Microsoft for building modern & performant iOS and Android apps with C# and . NET.

Is Xamarin a C++?

Xamarin provides the facility to include Objective-C, Java, and C++ libraries directly. It gives us the ability to reuse all the 3rd party codebases, which are Java, Objective-C, or C++. Xamarin offers cross-platform support for the three major mobile platforms (Android, iOS, and Windows).

Is Xamarin similar to C#?

Technically speaking, Xamarin uses C# and native libraries wrapped in the . Net layer for cross-platform app development. Such applications are often compared to native for both iOS and Android mobile development platforms in terms of performance and user experience.

Is Xamarin being discontinued?

Xamarin support will end on May 1, 2024 for all Xamarin SDKs. Android 13 and Xcode 14 SDKs (iOS and iPadOS 16, macOS 13) will be the final versions Xamarin will target.


1 Answers

Most "Set" methods in Android are converted to C# Properties in Xamarin. So

SetPaintFlags(Paint.Underline_Text_Flag);

becomes

my_object.PaintFlags = PaintFlags.UnderlineText;
like image 143
Jason Avatar answered Sep 28 '22 00:09

Jason