鸿蒙开发 之 ArkTsUI基础组件

介绍

ArkTS是鸿蒙生态的应用开发语言。它在保持TypeScript(简称TS)基本语法风格的基础上,对TS的动态类型特性施加更严格的约束,引入静态类型。同时,提供了声明式UI、状态管理等相应的能力,让开发者可以以更简洁、更自然的方式开发高性能应用。
之前前端开发需要掌握html css javascript 三种不同的语言,现在只需要ArkTS
在这里插入图片描述

ArkUI组件—Image组件

在这里插入图片描述
图片打包和模拟机上显示不出来需要配置授权申请
地址

@Entry
@Component
struct Index {
  @State message: string = 'hello world'
  build() {
   Row(){
    Column() {
       Image($r('app.media.icon'))
       .width(250)
       .interpolation(ImageInterpolation.High)
    }
    .width('100%')
   }
   .height('100%')
  }
 }

ArkUI组件—text组件

在这里插入图片描述

@Entry
@Component
struct Index {
  @State message: string = 'hello world'
  build() {
   Row(){
    Column() {
       Image($r('app.media.icon'))
       .width(250)
       .interpolation(ImageInterpolation.High)
       Text($r('app.string.width_label'))
       .fontSize(20)
       .fontWeight(FontWeight.Bold)
    }
    .width('100%')
   }
   .height('100%')
  }
 }
 

en_US/element/string.json

   {
      "name": "width_label",
      "value": "Image Width: "
    },

zh_CN/element/string.json

     {
      "name": "width_label",
      "value": "图片宽度: "
    }

ArkUI组件—textInput

在这里插入图片描述

@Entry
@Component
struct Index {
  @State message: string = 'hello world'
  build() {
   Row(){
    Column() {
       Image($r('app.media.icon'))
       .width(250)
       .interpolation(ImageInterpolation.High)
       Text($r('app.string.width_label'))
       .fontSize(20)
       .fontWeight(FontWeight.Bold)
       TextInput({text:'1234'})
       .width(150)
       .backgroundColor('#36D')
       .type(InputType.Password)
    }
    .width('100%')
   }
   .height('100%')
  }
 }

ArkUI组件—Button

这里是引用

这里是引用

ArkUI组件—Silder

在这里插入图片描述

ArkUI组件—column

在这里插入图片描述

在这里插入图片描述

ArkUI组件—循环

这里是引用
这里是引用

ArkUI组件—List

这里是引用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jiojio冲冲冲

能帮助你是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值