Skip to content Skip to sidebar Skip to footer

Using Xml Layout For Textview

I use Xamarin and I have the following code: base.OnCreate (bundle); TextView textView = new TextView (this.ApplicationContext); textView.AutoLinkMask = Android.Text.Util.MatchOpt

Solution 1:

textview.xml:

<?xml version="1.0" encoding="utf-8"?><TextViewxmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/txtView"android:layout_width="fill_parent"android:layout_height="wrap_content"android:text="This is a phone number 0800 32 32 32"android:autoLink="phone"></TextView>

In onCreate just mention

setContentView(R.layout.textview);

Solution 2:

<?xml version="1.0" encoding="utf-8"?><TextViewxmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/textview"android:text="This is a phone number 0800 32 32 32"android:autoLink="phone"
/>

Post a Comment for "Using Xml Layout For Textview"