0

Ive got a Layout where I have viewpager with sliding tabs.Now I want to make the upper part of my layout transparent so I get the effect that the activity before it is kinda visible. It should look like this :

My 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="match_parent"
android:orientation="vertical"
tools:context=".Main">            

<include
    android:id="@+id/tool_bar"
    layout="@layout/tool_bar"
    android:layout_marginTop="200dp" //THIS part should make the upper piece transparent
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    />

<com.kas.SlidingTabs.SlidingTabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:elevation="2dp"
    android:background="@color/colorPrimary"/>

<android.support.v4.view.ViewPager
    android:id="@+id/pager"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    ></android.support.v4.view.ViewPager>

My Apptheme I used in this Activity :

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

I allready tried @android:color/transparent as background in LinearLayout but its not helping.I also tried this solution https://stackoverflow.com/a/8831226/4035864

But then my logcat says :You need to use a Theme.AppCompat theme (or descendant) with this activity.

EDIT: ToolbarLayout :

    <?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:background="@color/colorPrimary"
    android:elevation="2dp"
    android:theme="@style/Base.ThemeOverlay.AppCompat.Dark"
    xmlns:android="http://schemas.android.com/apk/res/android" />
Community
  • 1
  • 1
Ahmet K
  • 713
  • 18
  • 42

0 Answers0