回复
     HarmonyOS应用开发-三方UI线程图组件练习
鸿蒙时代
 发布于 2021-10-23 11:00
 浏览
 0收藏
HarmonyOS已陆续推出1000+组件,包含UI、动画图形、框架、安全、工具、网络、文件数据、多媒体、图片缓存和基础功能,具有多设备形态可用、多端部署、性能优化三大特点。使用组件可以快速进行项目的开发。
下面是我进行组件使用过程。
修改gradle文件,引用组件:
allprojects {
repositories {
…
maven { url “https://jitpack.io” }
…
}
此处引用的是一个UI线程图组件,可以在页面布局代码中直接使用,如下:
<?xml version=“1.0” encoding=“utf-8”?>
<DirectionalLayout
xmlns:ohos=“http://schemas.huawei.com/res/ohos”
ohos:height=“match_parent”
ohos:width=“match_parent”
ohos:alignment=“center”
ohos:orientation=“vertical”>
<com.jjoe64.graphveiw.helper.GraphViewXML
    ohos:id="$+id:graphViewXml"
    ohos:height="200vp"
    ohos:width="match_parent"
    ohos:seriesData="0=0;1=1;2=2;3=3"
    ohos:seriesTitle="test5"
    ohos:seriesColor="#FF0000"
    ohos:title ="test1"/>
</DirectionalLayout>
效果如下:

完整代码地址:
https://gitee.com/jltfcloudcn/jump_to/tree/master/UI线程图组件
标签 
 HarmonyOS应用开发-三方UI线程图组件练习.docx 31.74K 8次下载  
        赞
        1
 
        收藏 
      
 回复
  相关推荐
 



















