作者 杨谦

1.直播网页显示报错问题

package com.br_technology.securitytrain_master.ui.view.mine.activity
import android.view.View
import com.br_technology.securitytrain_master.databinding.ActivityLiveWebBinding
import com.br_technology.securitytrain_master.ui.view.mine.viewmodel.LiveWebViewModel
import com.tencent.smtt.sdk.WebSettings
import com.wjx.android.wanandroidmvvm.base.view.BaseLifeCycleActivity
/**
... ... @@ -19,10 +21,23 @@ class LiveWebActivity :
override fun initData() {
super.initData()
val url = intent.getStringExtra("url") ?: ""
val title = intent.getStringExtra("title")?:""
val title = intent.getStringExtra("title") ?: ""
binding.apply {
toolBar.setTitle(title)
liveWeb.loadUrl(url)
liveWeb.apply {
settings.javaScriptEnabled = true
settings.useWideViewPort = true
settings.loadWithOverviewMode = true
settings.allowFileAccess = true
settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY
isScrollContainer = false
isVerticalScrollBarEnabled = false
isHorizontalScrollBarEnabled = false
setBackgroundColor(0); // 设置背景色
}
}
}
}
\ No newline at end of file
... ...