Question: I have a `bootstrap selectpicker` and a `chatbox` on the same page. The `selectpicker` is always above the `chatbox` like in the picture below:

[![enter image description here](https://i.stack.imgur.com/9TEmR.png)](https://i.stack.imgur.com/9TEmR.png)

I tried setting the chatbox `z-index` to 999999 and changing `margin` to negative (`-90px`) like indicated in other SO posts. But does not seem to work.

How can i fix this?

**Chat box log css**

```
padding: 3px;
height: 250px;
overflow-y: auto;
overflow-x: hidden;
background: #fff;
position: relative;
margin: -90px auto;
z-index: 9000000;

```

**JSfiddle**

<https://jsfiddle.net/iliadeviatov/s5tmy4z7/6/>

Answer: 
You can draw your own shadow just above the bottom bar using simple View and its background:

```
<View
    android:layout_width="match_parent"
    android:layout_height="4dp"
    android:layout_above="@id/bottom_bar"
    android:background="@drawable/shadow"/>

```

drawable/shadow.xml:

```
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:startColor="#1F000000"
        android:endColor="@android:color/transparent"
        android:angle="90" />
</shape>

```

Also, there are no compatibility issues if use this approach.
You can use elevation to add shadows to any view

```
<TextView
android:id="@+id/myview"
...
android:elevation="2dp"

android:background="@drawable/myrect" />

```

Refer [this](https://developer.android.com/training/material/shadows-clipping.html) for more information