Change color of the background

This is my app: https://ibb.co/jgpfCa

I want to make the black color to be white, but it seems like i can't find the way to change it.

I want to change it to white because when i'm applying a content padding in my recyclerview it shows the black colors in the background

Here's my xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:background="#fff"
    android:orientation="horizontal">

    <com.github.vipulasri.timelineview.TimelineView
        android:id="@+id/time_marker"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        app:line="@color/colorPrimary"
        app:lineSize="3dp"

        app:markerSize="20dp" />

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginBottom="15dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="15dp"
        android:background="#fff"
        android:backgroundTint="#fff"
        app:cardElevation="1dp"
        app:contentPadding="15dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center"
            android:orientation="vertical">

            <android.support.v7.widget.AppCompatTextView
                android:id="@+id/text_timeline_date"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="#994495"
                android:textSize="12sp"
                tools:text="24 JAN" />

            <android.support.v7.widget.AppCompatTextView
                android:id="@+id/text_timeline_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:textColor="@android:color/black"
                tools:text="Order Successfully Completed" />

        </LinearLayout>

    </android.support.v7.widget.CardView>

</LinearLayout>

U can use style.xml for this purpose like this

Style.xml

  <resource>

  <style name="AppTheme" parent="android:Theme.Light">
      <item name="android:background">@color/white_opaque</item>
      <item name="android:windowBackground">@color/white_opaque</item>
      <item name="android:colorBackground">@color/white_opaque</item>

    </style>
</resources>

Color.xml

<color name="white_opaque">#FFFFFFFF</color>
<color name="pitch_black">#FF000000</color>

manifest file

  <application
     .
     .
        android:theme="@style/AppTheme" > 
</application>

You had the wrong #code for white. White is "#ffffffff".

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#ffffffff"
android:orientation="horizontal">
链接地址: http://www.djcxy.com/p/88942.html

上一篇: 基于背景颜色的文本颜色

下一篇: 更改背景的颜色