【问题标题】:Adaptive Icon shapes path自适应图标形状路径
【发布时间】:2018-12-13 10:30:30
【问题描述】:

这就是 Launcher3 定义图标形状路径的方式。

<string-array translatable="false" name="icon_shape_override_paths_values">
    <item>M50,0L100,0 100,100 0,100 0,0z</item>
    <item>M50,0 C10,0 0,10 0,50 0,90 10,100 50,100 90,100 100,90 100,50 100,10 90,0 50,0 Z</item>
    <item>M50 0A50 50,0,1,1,50 100A50 50,0,1,1,50 0</item>
    <item>M50,0A50,50,0,0 1 100,50 L100,85 A15,15,0,0 1 85,100 L50,100 A50,50,0,0 1 50,0z</item>
</string-array>

这些分别对应方形、松鼠、圆形和泪珠。

现在我想知道如何创建自己的形状。我想画一个六边形。

【问题讨论】:

  • 你问的是如何绘制六边形,或者如何将形状添加到Launcher3?
  • @PaulLeBeau 如何以这种方式绘画

标签: android svg android-launcher android-icons adaptive-icon


【解决方案1】:

尝试类似:

<item>M 50,0 L 100,25, 100,75, 50,100, 0,75, 0,25 Z</item>

例子:

svg {
  background: linen;
}
<svg width="100" height="100">
  <path d="M 50,0 L 100,25, 100,75, 50,100, 0,75, 0,25 Z"/>
</svg>

【讨论】:

  • 请问你是怎么画的,比如inkscape可以吗?
  • 我只是在编辑器中手动完成的。 M 是移动到,L 是用于行。其他形状是基于 100x100 的正方形,所以我只是在左侧和右侧(即 25 和 75)上试验了 Y 坐标,直到六边形看起来没问题。这里不需要 Inkscape,因为它是一个非常简单的形状。但是,是的,如果你愿意,你可以使用 Inkscape。
猜你喜欢
  • 2021-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-03-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多