Commit d3bcc71d authored by wangxuewei's avatar wangxuewei

Merge remote-tracking branch 'origin/develop_luckyfarm_1.0.1' into develop_luckyfarm_1.0.1

parents 3008cb15 2af46c8d
......@@ -47,20 +47,14 @@ public class WebViewActivity extends BaseActivity {
} else {
rl.setVisibility(View.GONE);
}
layout = findViewById(R.id.activity_webview_layout);
initWebView();
webView = findViewById(R.id.activity_webview_layout);
initTitle();
initWebView();
}
private void initWebView() {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
webView = new WebView(this);
webView.setBackgroundColor(getResources().getColor(R.color.color_FEDA83));
//设置WebView的宽高
webView.setLayoutParams(layoutParams);
//把webView添加到容器中
layout.addView(webView);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);
// webView.getSettings().setDefaultFontSize(56);
......@@ -106,7 +100,7 @@ public class WebViewActivity extends BaseActivity {
finish();
}
});
TextView tv_title = findViewById(R.id.tv_user_toolbar_title);
TextView tv_title = findViewById(R.id.tv_user_title);
tv_title.setText(title);
}
......@@ -135,11 +129,7 @@ public class WebViewActivity extends BaseActivity {
protected void onDestroy() {
super.onDestroy();
if (webView != null) {
webView.clearView();
webView.removeAllViews();
webView.destroy();
webView = null;
layout.removeView(webView);
}
}
......
......@@ -9,35 +9,33 @@
android:layout_width="match_parent"
android:layout_height="90dp"
android:background="#994B00">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true">
<ImageView
android:id="@+id/id_iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_webview_back"
android:layout_centerVertical="true"
android:layout_marginLeft="14dp"
android:layout_centerVertical="true"/>
android:src="@drawable/icon_webview_back" />
<TextView
android:id="@+id/tv_user_toolbar_title"
android:id="@+id/tv_user_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="#ffffffff"
android:textSize="18sp"
android:textStyle="bold"
android:layout_centerInParent="true"/>
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
<WebView
android:id="@+id/activity_webview_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
</LinearLayout>
android:layout_height="match_parent" />
</LinearLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment