HarmonyOS应用开发-Svg组件line体验

鸿蒙时代
发布于 2022-1-26 10:08
浏览
0收藏

HarmonyOS应用开发-Svg组件line体验-鸿蒙开发者社区
一、说明
绘制线条。

说明:该组件从API version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。

二、子组件
支持animate、animateMotion、animateTransform。

三、属性
支持Svg组件通用属性和以下属性。
HarmonyOS应用开发-Svg组件line体验-鸿蒙开发者社区

四、案例

<div class="container">
    <svg width="400" height="400">
        <line x1="10" x2="300" y1="50" y2="50" stroke-width="4" fill="white" stroke="blue"></line>
        <line x1="10" x2="300" y1="100" y2="100" stroke-width="4" fill="white" stroke="blue"></line>
        <line x1="10" x2="300" y1="150" y2="150" stroke-width="10" stroke="red" stroke-dasharray="5 3" stroke-dashoffset="3"></line>
        <line x1="10" x2="300" y1="200" y2="200" stroke-width="10" stroke="black" stroke-linecap="round"></line>
        <line x1="10" x2="300" y1="220" y2="220" stroke-width="10" stroke="black" stroke-linecap="butt"></line>
        <line x1="10" x2="300" y1="240" y2="240" stroke-width="10" stroke="black" stroke-linecap="square"></line>
    </svg>
</div>

效果:
HarmonyOS应用开发-Svg组件line体验-鸿蒙开发者社区

完整代码地址为:
https://gitee.com/jltfcloudcn/jump_to/tree/master/line

分类
标签
HarmonyOS应用开发-Svg组件line体验.docx 22.94K 13次下载
收藏
回复
举报
回复
    相关推荐