【问题标题】:Clickable Link inside an Android .html raw fileAndroid .html 原始文件中的可点击链接
【发布时间】:2016-04-05 00:13:51
【问题描述】:

我在内部使用 webview 进行片段布局,并在创建片段时使用本地 .html 文件进行加载。但我想要一个可点击的链接,点击后会打开互联网浏览器,将您带到网页。如何才能做到这一点?

XML 布局

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/first_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:paddingBottom="5dp">

<WebView
    android:id="@+id/setup_webview"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

</ScrollView>

我的本​​地 .html 文件

<!DOCTYPE html>
<html>
<link>

<h1 style="background-color:#000044;color:white">&nbsp;Setup</h1>

<p>There are two ways to set up the app to be able to connect to a robot. You can use a simulated robot, or a real robot.</p>

<hr>

<h3><font color="#000044">Using a Simulated Robot</font></h3>
<p>It is likely easier to access a simulated robot than a real one so follow these steps to set it up</p>

<h4><font color="#000044">Step 1: Installing Ubuntu 14.04.3</font></h4>
<p>Download a 32 or 64 bit Ubuntu 14.04.3 iso, either will work, and install it on a physical computer or a virtual machine.</p>
<p>The robot will move much much smoother if Ubuntu 14.04 is installed to a physical computer.</p>

<h4><font color="#000044">Step 2: Installing ROS Indigo</font> </h4>
<p>Once you have Ubuntu installed, follow the instructions at <link>http://wiki.ros.org/indigo/Installation/Ubuntu</link></p>


<br>

目前的样子

【问题讨论】:

    标签: android html android-layout webview android-webview


    【解决方案1】:

    只需使用标准的html link tag (&lt;a href=...&gt;)

    【讨论】:

      猜你喜欢
      • 2013-02-18
      • 2020-12-07
      • 1970-01-01
      • 2020-08-20
      • 2016-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多