0

My title bar looks like this:

image 1

I'm trying to make it transparent to get only the navigation icon & map full screen into the map view, but every time I am trying the transparent code to make the bar transparent it's ended up showing the white color.

I also try ed NoAction bar but its still ended up showing a white title bar.

Home_activity.xml

<RelativeLayout 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="match_parent"
android:background="@android:color/transparent"
android:scrollbars="horizontal">

<RelativeLayout
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <android.support.v4.widget.DrawerLayout xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/transparent"
        tools:openDrawer="start">

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

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:layout_gravity="center"
                android:background="@android:color/transparent"
                android:fitsSystemWindows="true"
                app:popupTheme="@style/Theme.AppCompat.NoActionBar">

            </android.support.v7.widget.Toolbar>
            <!-- The first child in the layout is for the main Activity UI-->
            <FrameLayout
                android:id="@+id/frame"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_alignTop="@+id/drawer_layout"

                android:scrollbars="horizontal"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                />

            </FrameLayout>
        </LinearLayout>

        <!-- Side navigation drawer UI -->

        <android.support.design.widget.NavigationView
            android:id="@+id/nav_view"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            app:headerLayout="@layout/navigation_header"
            app:itemBackground="@drawable/naviagtionview_statecolor"
            app:itemIconTint="@color/black"
            app:itemTextColor="@color/black"
            app:menu="@menu/my_navigation_items">

        </android.support.design.widget.NavigationView>


    </android.support.v4.widget.DrawerLayout>
</RelativeLayout>

style.xml

<resources xmlns:tools="http://schemas.android.com/tools">

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/hint</item>
    <item name="drawerArrowStyle">@style/MyDrawerArrowToggle</item>
    <item name="colorPrimaryDark">@color/hint</item>
    <item name="colorAccent">@color/black</item>
    <item name="actionBarStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>




</style>
<style name="MyTheme.ActionBar" parent="android:Widget.Holo.ActionBar">
    <item name="android:background">@android:color/transparent</item>
    <item name="android:backgroundStacked">@android:color/transparent</item>
    <item name="android:displayOptions">showTitle</item>
    <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
</style>
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="drawerArrowStyle">@style/MyDrawerArrowToggle</item>



</style>

<style name="MyTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance">
    <item name="android:textColor">@color/black</item>

</style>

<style name="MyDrawerArrowToggle" parent="Widget.AppCompat.DrawerArrowToggle">
    <item name="color">@color/black</item>

</style>

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />



<style name="EditText.Login" parent="Widget.AppCompat.EditText">
    <item name="android:textColor">@android:color/black</item>
    <item name="android:textColorHint">@android:color/darker_gray</item>
    <item name="colorAccent">@color/yellow</item>
    <item name="colorControlNormal">@color/black</item>
    <item name="colorControlActivated">@color/yellow</item>
</style>

But it's showing like this:

image 2

Suleyman
  • 2,765
  • 2
  • 18
  • 31

1 Answers1

0

I had a similar issue, I used different ways to implement it, you may try this to make toolbar transperent.

Amin Pinjari
  • 2,129
  • 3
  • 25
  • 53
  • This link may definitely be useful and answer the question, but if it dies then this answer will no longer be useful, either comment the link or make sure to include the important part of the answer here, so that it's useful on its own. – Suleyman Jun 09 '18 at 11:01
  • i try ed adding it but the result is still showing white background at titlebar – MD Khathamoon Nabien Jun 09 '18 at 11:30