如何使用下面的命令运行一个简单的链接?
<TextView
android:text="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView1" />
TextView textView = FindViewById<TextView>(Resource.Id.textView1);
textView.TextFormatted = Android.Text.Html.FromHtml("https://www.google.com");
textView.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance;这些工作:
textView.TextFormatted = Android.Text.Html.FromHtml("<a href=\"" + "https://www.google.com" + "\">google</a>");
textView.TextFormatted = Android.Text.Html.FromHtml("<a href=\"" + "https://www.google.com" + "\">https://www.google.com</a>");这也不起作用:
<TextView
android:text="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:id="@+id/textView1" />
textView.TextFormatted = Android.Text.Html.FromHtml("<u>" + "https://www.google.com" + "</u>");发布于 2021-07-30 02:21:19
https://stackoverflow.com/questions/68575866
复制相似问题