BridgeWebView
- 在project的build.gradle添加如下代码
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
compile 'com.github.open-android:BridgeWebView:v1.0'
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.itheima.view.BridgeWebView
android:id="@+id/activity_test_webView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
package com.example.jackboard;
import android.os.Bundle;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.itheima.view.BridgeWebView;
public class TestActivity extends AppCompatActivity {
private BridgeWebView webView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);//隐藏状态栏
setContentView(R.layout.activity_test);
webView = (BridgeWebView)findViewById(R.id.activity_test_webView);
String url = "http://mes.uchat.com.cn/board/line?deptid=1&name=youchan";//带Echarts图表的网址
webView.loadUrl(url);//显示H5页面
}
}
网友评论