Ich habe eine Light-Theme-App und in einem der Bildschirme habe ich eine Recycler-Ansicht, dass ich dunkel sein muss.Light Theme App mit Dark Theme RecyclerView
Ich habe versucht, das Thema der Recyclerview zu "@ style/ThemeOverlay.AppCompat.Dark", aber der RecyclerView bleibt mit der gleichen Hintergrundfarbe, nur der Text erscheint als weiß auf der Vorschau, aber auf dem realen Gerät es Stills zeigt sich als dunkel (und wenn ich also einen Hintergrund anlege, kann es nicht gelesen werden).
Dies ist der Punkt Layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
style="@style/ThemeOverlay.AppCompat.Dark"
android:padding="@dimen/single_padding"
android:theme="@style/Base.ThemeOverlay.AppCompat.Dark">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="52''"
style="@style/ThemeOverlay.AppCompat.Dark"
tools:text="52''"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/single_padding"
android:src="@mipmap/ic_launcher_round"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Title"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Subtitle"/>
</LinearLayout>
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/logo"
/>
</LinearLayout>
Und das ist, wie ich meinen recyclerview erklären:
<android.support.v7.widget.RecyclerView
android:id="@+id/highlights_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/ThemeOverlay.AppCompat.Dark"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:listitem="@layout/highlight_list_item"/>
manuell eingestellt 'android.textColor =„# ffffff“' für Textview –