How to set background transparent on toolbar in android -
i want set background of toolbar transparent.
<?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/transparent" android:theme="@style/themeoverlay.appcompat.dark" android:elevation="4dp" android:id="@+id/tool_bar_org" android:paddingtop="0dp"> </android.support.v7.widget.toolbar>
here toolbar layout background not being transparent
just show in white color
toolbar = (toolbar) findviewbyid(r.id.tool_bar_org); toolbar.getbackgroud().setalpha(0); setsupportactionbar(toolbar);
its not working. can please tell me how make transparent.
this theme have used in project make appcompact actionbar transparent, modify according needs:
<style name="adhoctheme" parent="theme.appcompat.light.darkactionbar"> <item name="android:actionbarstyle">@style/adhocblack</item> <item name="actionbarstyle">@style/adhocblack</item> <item name="android:windowactionbaroverlay">true</item> <item name="windowactionbaroverlay">true</item> </style> <style name="adhocblack" parent="@style/widget.appcompat.light.actionbar.solid.inverse"> <item name="android:background">#0d000000</item> <item name="background">@color/appcompact_transparent_actionbar_bg</item> <item name="android:icon">@drawable/logo_header_2</item> </style>
where appcompact_transparent_actionbar_bg = #0d000000
important:
have here check how different values folders contain specific style files render on various api's
Comments
Post a Comment