Skip to content Skip to sidebar Skip to footer

How To Make Title Background Transparent On Android App

There is an issue in the follow Android App where guidance is greatly appreciated. This application is to support a Renesas RX130 microcontroller and Texas Instrument CC2650 Blueto

Solution 1:

There is a conflict in color from multiple source to background.

Don't use theme unless if needed, as

  • theme influence all the views and layouts inside the toolbar

  • style influence only the toolbar and does not interfere with views and layouts inside toolbar

Please try below options, one of which might work for you,

Option 1 (preferred): update CustomerToolbarStyle code as below

<stylename="CustomerToolbarStyle"parent="Theme.AppCompat.Light.NoActionBar"><itemname="android:background">@drawable/ic_launcher_background_rx130_cc2650</item><itemname="android:title">@color/colorforeground</item></style>

update toolbar.xml code as below

<android.support.v7.widget.Toolbar 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"
    app:popupTheme="@style/CustomerPopUpMenuStyle"
    style= "@style/CustomerToolbarStyle"
    app:titleTextColor="@android:color/white"/>

Option 2: set transparent background in CustomerToolbarStyle

<stylename="CustomerToolbarStyle"parent="Theme.AppCompat.Light.NoActionBar"><!-- set background color to transperant --><itemname="android:background">#00000000</item><itemname="android:title">@color/colorforeground</item></style>

Option 3: remove android:background from the CustomerToolbarStyle

<stylename="CustomerToolbarStyle"parent="Theme.AppCompat.Light.NoActionBar"><itemname="android:title">@color/colorforeground</item></style>

Option 4: remove app:theme="@style/CustomerToolbarStyle" from toolbar.xml

If above options not working, please check below links

Post a Comment for "How To Make Title Background Transparent On Android App"