html代码 打开本地文件,打开本地HTML文件
我在布局中有一個textview(名為-t_c),代碼為: -
android:id="@+id/GoToTCContacting"
android:layout_width="360dp"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_weight="2"
android:background="@drawable/border2"
android:clickable="true"
android:onClick="GoToTCContacting"
android:padding="10dp"
android:text="Contacting"
android:textColor="#FFF"
android:textSize="18sp" />
我希望textview在點擊上打開另一個布局(稱為-t_c_contacting),其中包含webview和webview以打開我在我的布局文件夾中名為con.html的html文件。
這就是t_c_contacting布局的編碼方式: -
android:id="@+id/contactingView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
這是我的課程設置為打開t_c_contacting的方式,但是我無法解決如何用我的文件填充webview的問題。
public void GoToTCContacting(View view)
{
setContentView(R.layout.t_c_contacting);
}
總結
以上是生活随笔為你收集整理的html代码 打开本地文件,打开本地HTML文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: apicloud使用指南
- 下一篇: 网站订单销售统计电商后台前端模板