首页 > 解决方案 > 我需要一个弧向量来自定义折叠工具栏

问题描述

我需要一个弧向量,我可以将其锚定在工具栏的底部,使其看起来像这样:

https://androidexample365.com/content/images/2018/12/ArcLayout.jpg

图片来自androidexample365

非常感谢任何愿意提供帮助的人。

标签: androidxmlvectortoolbardrawable

解决方案


这是您需要的自定义折叠工具栏的弧向量

    <?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="500dp"
android:height="500dp"
android:viewportWidth="500"
android:viewportHeight="500">

<path
    android:fillColor="#000000"
    android:fillAlpha="0"
    android:strokeColor="#000000"
    android:strokeWidth="1"
    android:pathData="" />
<path
    android:fillColor="#000000"
    android:fillAlpha="0"
    android:strokeColor="#000000"
    android:strokeWidth="1"
    android:pathData="" />
<path
    android:fillColor="#389282"
    android:strokeWidth="1"
    android:pathData="M185.94 399.69C268.86 381.15 373.54 400.53 500 457.84L500 500L0 498.71L0 457.84C41.04 437.61 103.02 418.23 185.94 399.69Z" />
<path
    android:fillColor="#000000"
    android:fillAlpha="0"
    android:strokeColor="#389282"
    android:strokeWidth="1"
    android:pathData="M185.94 399.69C268.86 381.15 373.54 400.53 500 457.84L500 500L0 498.71L0 457.84C41.04 437.61 103.02 418.23 185.94 399.69Z" />
<path
    android:fillColor="#389282"
    android:fillAlpha="0"
    android:strokeColor="#389282"
    android:strokeWidth="1"
    android:pathData="M185.94 399.69C268.86 381.15 373.54 400.53 500 457.84L500 500L0 498.71L0 457.84C41.04 437.61 103.02 418.23 185.94 399.69Z" />

另一个是

    <?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="500dp"
android:height="500dp"
android:viewportWidth="500"
android:viewportHeight="500">

<path
    android:fillColor="#000000"
    android:fillAlpha="0"
    android:strokeColor="#000000"
    android:strokeWidth="1"
    android:pathData="" />
<path
    android:fillColor="#000000"
    android:fillAlpha="0"
    android:strokeColor="#000000"
    android:strokeWidth="1"
    android:pathData="" />
<path
    android:fillColor="#389282"
    android:strokeWidth="1"
    android:pathData="M185.94 72.51C268.86 85.91 373.54 71.9 500 30.48L500 0L0 0.93L0 30.48C41.04 45.1 103.02 59.11 185.94 72.51Z" />
<path
    android:fillColor="#000000"
    android:fillAlpha="0"
    android:strokeColor="#389282"
    android:strokeWidth="1"
    android:pathData="M185.94 72.51C268.86 85.91 373.54 71.9 500 30.48L500 0L0 0.93L0 30.48C41.04 45.1 103.02 59.11 185.94 72.51Z" />
<path
    android:fillColor="#389282"
    android:fillAlpha="0"
    android:strokeColor="#389282"
    android:strokeWidth="1"
    android:pathData="M185.94 72.51C268.86 85.91 373.54 71.9 500 30.48L500 0L0 0.93L0 30.48C41.04 45.1 103.02 59.11 185.94 72.51Z" />

这是我遵循的矢量图像的一些建议

首先,根据需要在线创建 SVG 文件,然后将其转换为矢量,很简单 :)


推荐阅读