当前位置: 首页 > news >正文

屯昌网站建设福州seo服务

屯昌网站建设,福州seo服务,大连网站建设选网龙,网站怎样做有利于seo鸿蒙(HarmonyOS)项目方舟框架(ArkUI)控件的部分公共属性和事件 一、操作环境 操作系统: Windows 10 专业版 IDE:DevEco Studio 3.1 SDK:HarmonyOS 3.1 二、公共属性 常用的公共属性有: 宽(with)、高(height)、…

鸿蒙(HarmonyOS)项目方舟框架(ArkUI)控件的部分公共属性和事件

一、操作环境

操作系统:  Windows 10 专业版

IDE:DevEco Studio 3.1

SDK:HarmonyOS 3.1

二、公共属性

常用的公共属性有:

宽(with)、高(height)、尺寸(size)、背景色(backgroudColor)、

Text().size({width: 220, height: 125}) // 设置宽高.width(120)                      // 设置宽度,覆盖前边的值.height(25)                      // 设置高度,覆盖前边的值.backgroundColor("#ccbbaa")      // 设置背景色

设置组件的宽高,缺省时使用组件自身内容的宽高,比如充满父布局可以使用 string 值:"100%",当组件同时设置 size 和 width / height 时,以最后设置的值为准。

外边距(padding)、内边距(margin)、

Stack() {Text().width('100%')               // 设置宽度充满父布局.height('100%')              // 设置高度充满父布局.backgroundColor(Color.Pink) // 设置背景色
}
.padding(10)                     // 设置四个边距值
.backgroundColor("#aabbcc")      // 设置背景色
.size({width: 80, height: 80})   // 设置宽高尺寸Stack() {Text().width('100%')               // 宽度充满父布局.height('100%')              // 高度充满父布局.backgroundColor(Color.Pink) // 设置背景色
}
.padding({left: 5, top: 20, right: 5, bottom: 20})// 设置不同的边距值
.backgroundColor("#aabbcc")                       // 设置背景色
.size({width: 80, height: 80})                    // 设置宽高尺寸

权重(layoutWeight)、对齐方式(align)、布局方向(direction对应的枚举
Ltr,Rtl,Auto)、相对定位(offset)、绝对定位(position)、

显示隐藏(visibility对应的枚举Visible,Hidden,None)

Row() {Text().height(30).width(120).backgroundColor("#aabbcc").layoutWeight(1)Text().height(30).backgroundColor("#aaccbb").visibility(Visibility.Visible) // 设置默认值Visible.layoutWeight(1)Text().height(30).backgroundColor(Color.Pink).layoutWeight(1)
}Row() {Text().height(30).width(120).backgroundColor("#aabbcc").layoutWeight(1)Text().height(30).backgroundColor("#aaccbb").visibility(Visibility.Hidden) // 设置Hidden,不在界面显示但是还占着位置.layoutWeight(1)Text().height(30).backgroundColor(Color.Pink).layoutWeight(1)
}Row() {Text().height(30).backgroundColor("#aabbcc").layoutWeight(1)Text().height(30).visibility(Visibility.None) // 设置None,不在界面上显示.backgroundColor("#aaccbb").layoutWeight(1)Text().height(30).backgroundColor(Color.Pink).layoutWeight(1)
}

三、公共事件

常用的公共事件:

点击事件(onClick)

Text('Click 亚丁号').width(120).height(40).backgroundColor(Color.Pink)      // 设置背景颜色.onClick(() => {                  // 设置点击事件回调console.log("text clicked 亚丁号") // 日志输出})

获得焦点事件、失去焦点事件

@Entry @Component struct ComponentTest {@State textOne: string = ''@State textTwo: string = ''@State textThree: string = ''@State oneButtonColor: string = '#FF0000'@State twoButtonColor: string = '#87CEFA'@State threeButtonColor: string = '#90EE90'build() {Column({ space: 10 }) {Button(this.textOne).backgroundColor(this.oneButtonColor).width(260).height(70).fontColor(Color.Black).focusable(true).onFocus(() => {this.textOne = 'First Button onFocus'this.oneButtonColor = '#AFEEEE'}).onBlur(() => {this.textOne = 'First Button onBlur'this.oneButtonColor = '#FFC0CB'})Button(this.textTwo).backgroundColor(this.twoButtonColor).width(260).height(70).fontColor(Color.Black).focusable(true)Button(this.textThree).backgroundColor(this.threeButtonColor).width(260).height(70).fontColor(Color.Black).focusable(true).onFocus(() => {this.textThree = 'Third Button onFocus'this.threeButtonColor = '#AFEEEE'}).onBlur(() => {this.textThree = 'Third Button onBlur'this.threeButtonColor = '#FFC0CB'})}.width('100%').height('100%').padding(10)}
}

目前支持焦点事件的组件:Button、 TextImage、 List、 Grid

好了就写到这吧!

你有时间常去我家看看我在这里谢谢你啦...

我家地址:亚丁号

最后送大家一首诗:

山高路远坑深,
大军纵横驰奔,

谁敢横刀立马?
惟有点赞加关注大军。

http://www.15wanjia.com/news/16114.html

相关文章:

  • 电商网站开发常用代码企业网站优化解决方案
  • 福建做网站的公司内容营销成功案例
  • 游戏网站平台怎么做360网站推广登录
  • 书店网站html模板seo服务外包公司
  • seo网站有哪些小学生收集的新闻10条
  • 做恶搞网站软件下载广州网络推广专员
  • jsp网站开发可行性分析小说风云榜
  • 设计logo网站是平面设计不千峰培训
  • 建设一个微网站要花多少钱服务器ip域名解析
  • wordpress首页热门排行显示安卓优化大师官方下载
  • 女的和女的做那个视频网站简单的seo
  • 备案新增网站备案百度网盘网站入口
  • 购物网站做推广西安seo网站排名
  • 公司注册大概多少钱百度整站优化
  • 动态网站用什么语言做百度seo关键词排名查询
  • WordPress网站远程访问泉州百度推广排名优化
  • 帮人家做网站维护抄一则新闻四年级
  • 制作app网站推广app拿返佣的平台
  • wordpress织梦博客seo优化技术
  • 南宁做网站推广seo关键词优化推广报价表
  • 做电影网站采集什么意思app运营方案
  • 苏州吴江网站建设广州百度推广代理公司
  • 虚拟主机怎么上传网站最近最火的关键词
  • 广东专业移动网站建设哪家好重庆发布的最新消息今天
  • web 设计网站模板下载产品推广软文范文
  • 公司注册核名在哪个网站2022适合小学生的简短新闻
  • 淘宝做网站很便宜清远新闻最新
  • 好看的旅游网站模版seo营销的概念
  • 日照网站制作公司网络工程师是干什么的
  • 杭州清风室内设计学校青岛seo公司