Alejandro Lora Alejandro Lora - 2 months ago 16
Android Question

Line Between Toolbar and Tabs - Android 5

I have a line between my toolbar and my tabs and I don't know why, because if my app is executed in another smartphone with Android 4.* the line is disappeared...

I am working on toolbar with tabs, I am using SlidingTabLayout and SlidingTabStrip from Google...

I don't know if there is some important information to say but if you need to know something more, let me know...

Thankss

EDIT: here a photo about this...

enter image description here

This is the activity's 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="es.alejandrolora.devhub.activitys.VideosCommentsActivity">

<include
android:id="@+id/toolbar"
layout="@layout/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<es.alejandrolora.devhub.Util.SlidingTabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:elevation="2dp" />

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



Answer

I tried my app in Android 5.0.2 on Motorola G2 and the line wasn't visible but in my version (5.1) on Nexus 5, it was, but I got fix the problem...

I just had to erase this attribute:

android:elevation="2dp"

Thanks

Comments