Ich habe zwei Themen für meine Aktivität erstellt; Hell dunkel. Aber wenn ich eine Änderung im Thema triggle, ändert sich die Farbe der Webseite, die in der Webansicht geladen wird, nicht.So ändern Sie den Hintergrund in der Webansicht
Ich habe dies myWebView.setBackgroundColor(Color.TRANSPARENT);
versucht, aber es macht keinen Unterschied. Also, wie würde ich darüber gehen?
Hier ist mein Layout bitte sehen Sie;
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
xmlns:night="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@color/ColorPrimary"
night:night_background="@color/colorPrimary_n"
tools:ignore="MissingPrefix">
<ProgressBar
android:id="@+id/progressBar3"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="3dp"
android:max="100"
android:progressDrawable="@drawable/greenprogress"
/>
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swiperefresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webViewTop"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
night:night_background="@color/colorPrimary_n"
android:layout_below="@id/progressBar3"/>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
was webView.setBackgroundColor (Color.TRANSPARENT); tut es das, macht es anfangs webview transparent, und am anfang der aktivität kann ich meine themenfarbe sehen, aber nachdem die webseite beginnt zu laden, verschwindet es, und die farbe der webseite findet statt. –
Nop, es funktioniert auch nicht. –