ToB企服应用市场:ToB评测及商务社交产业平台

标题: 鸿蒙学习条记:用户登录界面 [打印本页]

作者: 饭宝    时间: 2024-12-22 07:38
标题: 鸿蒙学习条记:用户登录界面
1. 提出使命


2. 完成使命

2.1 创建鸿蒙项目


2.2 准备图片资源


2.3 编写首页代码


  1. @Entry
  2. @Component
  3. struct Index {
  4.   @State message: string = '用户登录';
  5.   build() {
  6.     Column() {
  7.       // 图片
  8.       Image($r('app.media.bear'))
  9.         .width(180)
  10.         .height(180)
  11.         .margin({top: 80, bottom: 80})
  12.       // 账号
  13.       TextInput({placeholder: '请输入账号'})
  14.         .maxLength(80)
  15.         .type(InputType.Number)
  16.         .margin({left: 20, right: 20, bottom: 10})
  17.       // 密码
  18.       TextInput({placeholder: '请输入密码'})
  19.         .maxLength(80)
  20.         .type(InputType.Password)
  21.         .margin({left: 20, right: 20})
  22.       // 登录
  23.       Button(('登录'), {type: ButtonType.Capsule})
  24.         .width(200)
  25.         .fontSize(30)
  26.         .fontWeight(FontWeight.Medium)
  27.         .padding({top: 10, bottom: 10})
  28.         .margin({top: 70, bottom: 20})
  29.       // 注册
  30.       Text('注册')
  31.         .fontColor(Color.Blue)
  32.         .fontSize(30)
  33.         .fontWeight(FontWeight.Medium)
  34.     }
  35.     .width('100%')
  36.   }
  37. }
复制代码

2.4 启动应用


3. 实战小结



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4