鸿蒙组件开发/如何创建组件 原创

BLUESKYHOST
发布于 2021-3-15 14:09
浏览
0收藏

第一步 创建

新建module 选择   library 下一步下一步完成即可鸿蒙组件开发/如何创建组件-鸿蒙开发者社区

第二步引入组件

在build.gradle 文件  dependencies 引入并且 syncNow

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
    testCompile 'junit:junit:4.12'
    /**
     * implementation 内部隐藏依赖项
     * compile
     */
    implementation 'com.zzrv5.zzrhttp:ZZRHttp:1.0.1'
    // 引入 mask 模块自定义组件
    implementation project(":mask")
//    compile "com.squareup.okhttp3:okhttp:3.10.0"
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.

 

第三步使用

正常的调用即可 ,如果有同名的注意包

©著作权归作者所有,如需转载,请注明出处,否则将追究法律责任
收藏
回复
举报


回复
    相关推荐