How to add height to transparent ImageView [android]

Is it really possible to implement the height of an ImageView with png that contains a transparent background? For example: I want to add a height mark to this mark:

enter image description here

Want to do this:

enter image description here

+4
source share
1 answer

In your XML add this:

android:elevation="2dp"    
android:background="@drawable/myrect"

In your Live folder, add this feature:

<!-- res/drawable/myrect.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <solid android:color="#42000000" />
    <corners android:radius="5dp" />
</shape>

See here for more information: http://developer.android.com/training/material/shadows-clipping.html

+1
source

Source: https://habr.com/ru/post/1612784/


All Articles