用xml制作一个箭头形状的两面 [英] Make an arrow shape both side with xml

查看:224
本文介绍了用xml制作一个箭头形状的两面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想像这样制作一个按钮形状

I want to make a button shape like this

有没有办法用XML做到这一点?

Is there a way to do this with XML?

实际上我正在寻找这样的

Actually I am looking for like this

推荐答案

我已经通过vector实现了这一目标.

I have achieved this by vector.

@KinjalShah请调查一下.

@KinjalShah Please look into this.

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt"
    android:width="138.25dp"
    android:height="23dp"
    android:viewportWidth="138.25"
    android:viewportHeight="23">
    <path android:pathData="M132.53,22.48l-132.27,0l5.36,-10.95l-5.36,-10.94l132.27,0l5.36,10.94z">
        <aapt:attr name="android:fillColor">
            <gradient
                android:endX="137.8946"
                android:endY="11.535"
                android:startX="0.2646"
                android:startY="11.535"
                android:type="linear">
                <item
                    android:color="#3b0b7b"
                    android:offset="0" />
                <item
                    android:color="#6244A5"
                    android:offset="1" />
            </gradient>
        </aapt:attr>
    </path>
</vector>

这篇关于用xml制作一个箭头形状的两面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆