D
D
Danila Stavrov2017-09-16 18:30:10
Java
Danila Stavrov, 2017-09-16 18:30:10

How to make a cut corner Image View?

Tell me how to make the same element as in the picture,
e3f50192ecc245a398619cc587fffd3f.PNG
at first I thought in the direction of the picture above the ImageView, but in the end it turned out this
5c203d4f05c648aca55ce0142bbf552c.PNG838b4cddc9164bd696a28462d6930c7a.PNG

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="1000dp"
    android:height="1000dp"
    android:viewportHeight="100"
    android:viewportWidth="100">
    <group android:name="triableGroup">
        <path
            android:name="triangle"
            android:fillColor="#ffffff"
            android:pathData="m 0,80 l 100,50 -100,0 z" />
    </group>
</vector>

You may need to create your own View, but I don’t know for sure, tell me where to look

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Varakosov, 2017-09-16
@thelongrunsmoke

The correct way is to use clipPath(). You create a new view that inherits ImageView and clip the incoming canvas in the onDraw() method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question