中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

番禺網(wǎng)站制作費用新網(wǎng)域名

番禺網(wǎng)站制作費用,新網(wǎng)域名,網(wǎng)站調(diào)研表,張家口市建設(shè)局網(wǎng)站前言: DevEco Studio版本:4.0.0.600 詳細使用介紹 1、Text的一些常用設(shè)置 Text(this.message).fontSize(50)//字體大小.fontColor(Color.White)//字體顏色.fontWeight(FontWeight.Bold)//字體加粗.backgroundColor(Color.Black)//背景顏色.fontStyle(…

前言:

DevEco Studio版本:4.0.0.600

詳細使用介紹

1、Text的一些常用設(shè)置

Text(this.message).fontSize(50)//字體大小.fontColor(Color.White)//字體顏色.fontWeight(FontWeight.Bold)//字體加粗.backgroundColor(Color.Black)//背景顏色.fontStyle(FontStyle.Italic) //字體傾斜.textOverflow({overflow: TextOverflow.Ellipsis})//文本超長顯示方式,TextOverflow.Ellipsis:以省略號結(jié)尾.maxLines(1)//設(shè)置文本的最大行數(shù)

TextOverflow屬性

效果:

參考文檔:OpenHarmony Text顯示文本

2、Text文字富文本

Text() {Span("《用戶協(xié)議》").fontColor(Color.Blue).decoration({ type: TextDecorationType.Underline, color: Color.Blue })//設(shè)置文本裝飾線樣式及其顏色。.onClick(() => {//實現(xiàn)點擊,跳轉(zhuǎn)到用戶協(xié)議界面})
}

效果:

參考文檔:OpenHarmony span富文本設(shè)置

3、線性邊框按鈕

Text('確定').fontColor(Color.Black).fontSize('28px').width('146px').height('48px').textAlign(TextAlign.Center).borderColor(Color.Blue)//邊框顏色.borderWidth('1px')//邊框?qū)挾?borderRadius('10px')//邊框圓角.onClick(() => {//實現(xiàn)點擊邏輯})

// 如果單獨設(shè)置某一個圓角可以通過下面方式設(shè)置,topLeft:左上角,topRight:右上角,bottomLeft:左下角,bottomRight:右下角

.borderRadius({ topLeft: '10px', topRight: '10px', bottomLeft: '10px', bottomRight: '10px' })

效果:

4、Image的一些常用設(shè)置

參考鏈接:OpenHarmony Image圖片

圓形圖片:

Image($r("app.media.startIcon")).width(100).height(100).clip(new Circle({ width: 100, height: 100 }))

圖片占位:

Image($r("app.media.startIcon")).width(100).height(100).alt($r("app.media.icon"))

圖片加載完成監(jiān)聽:

Image($r("app.media.startIcon")).width(100).height(100).onComplete((event: {width: number,height: number}) => {console.info("圖片寬度:" + event.width + "圖片高度:" + event.height)})
參數(shù)名類型說明
widthnumber圖片的寬。
單位:像素
heightnumber圖片的高。
單位:像素
componentWidthnumber組件的寬。
單位:像素
componentHeightnumber組件的高。
單位:像素
loadingStatusnumber圖片加載成功的狀態(tài)值。
說明:
返回的狀態(tài)值為0時,表示圖片數(shù)據(jù)加載成功。返回的狀態(tài)值為1時,表示圖片解碼成功。
contentWidth(10+)number圖片實際繪制的寬度。
單位:像素
說明:
僅在loadingStatus返回1時有效。
contentHeight(10+)number圖片實際繪制的高度。
單位:像素
說明:
僅在loadingStatus返回1時有效。
contentOffsetX(10+)number實際繪制內(nèi)容相對于組件自身的x軸偏移。
單位:像素
說明:
僅在loadingStatus返回1時有效。
contentOffsetY(10+)number實際繪制內(nèi)容相對于組件自身的y軸偏移。
單位:像素
說明:
僅在loadingStatus返回1時有效。

5、接口回調(diào)

自定義一個View:ImageTest

@Component
export struct ImageTest {//用于點擊“確定”按鈕的回調(diào) (API10的寫法)private onButtonClick: () => void = () => {}build() {Text('確定').fontColor(Color.Black).fontSize('28px').width('146px').height('48px').textAlign(TextAlign.Center).borderColor(Color.Blue).borderWidth('1px').borderRadius('10px').onClick(() => {this.onButtonClick()})}
}

ImageTest的引用

ImageTest({ onButtonClick: () => {promptAction.showToast({message: '我是回調(diào)的數(shù)據(jù)',duration: 2000,})
} })

6、自定義Dialog彈窗

參考文檔:OpenHarmony 自定義彈窗

使用@CustomDialog裝飾器裝飾自定義彈窗

@CustomDialog
export struct MessageDialog {build() {}
}

7、多態(tài)樣式

參考鏈接:OpenHarmony 多態(tài)樣式

stateStyles樣式狀態(tài):

  • focused:獲焦態(tài)。

  • normal:正常態(tài)。

  • pressed:按壓態(tài)。

  • disabled:不可用態(tài)。

  • selected:選中態(tài)。(API 10中新增)

@Entry
@Component
struct Index {@StylesnormalStyle() {.backgroundColor(Color.White)}@StylespressedStyle() {.backgroundColor(Color.Gray)}build() {Column() {Text('確定').fontSize('28px').width('146px').height('48px').textAlign(TextAlign.Center).borderColor(Color.Blue).borderWidth('1px').borderRadius('10px').stateStyles({normal: this.normalStyle,pressed: this.pressedStyle})}.justifyContent(FlexAlign.Center).width('100%').height('100%')}
}

8、日期格式化

@Entry
@Component
struct Index {@State message: string = '';aboutToAppear() {setInterval(() => {this.initDate()}, 1000)}initDate() {let date = new Date()let year = this.format(date.getFullYear()) //獲取年份let month = this.format(date.getMonth() + 1) //獲取月份let day = this.format(date.getDate()) //獲取天數(shù)let hours = this.format(date.getHours()) //獲取小時let minutes = this.format(date.getMinutes()) //獲取分鐘let seconds = this.format(date.getSeconds()) //獲取秒數(shù)this.message = year + '年' + month + '月' + day + '日  ' + hours + ':' + minutes + ':' + seconds}/*** 不足十位前面補零*/format(param: number) {let value = '' + paramif (param < 10) {value = '0' + param}return value}build() {Column() {Text(this.message).fontSize(30)//字體大小.fontColor(Color.Black)//字體顏色.fontWeight(FontWeight.Bold) //字體加粗}.justifyContent(FlexAlign.Center).width('100%').height('100%')}
}

效果:

或者通過@ohos.intl (國際化-Intl)來實現(xiàn),參考文檔:

OpenHarmony DateTimeFormat日期格式化

http://www.risenshineclean.com/news/38305.html

相關(guān)文章:

  • 表單大師 做網(wǎng)站濟南頭條今日新聞
  • 高性能網(wǎng)站建設(shè)指南pdfsem競價托管
  • b2b電子商務(wù)網(wǎng)站的收益模式主要有百度提交網(wǎng)站入口網(wǎng)址
  • wordpress數(shù)據(jù)大不行網(wǎng)站seo分析案例
  • 男女主網(wǎng)站上做的popo白度指數(shù)
  • 硅云網(wǎng)站建設(shè)視頻專門做推廣的軟文
  • 哪個公司做企業(yè)網(wǎng)站好網(wǎng)站如何推廣營銷
  • 網(wǎng)站架構(gòu)的組成部分友情鏈接系統(tǒng)
  • 做網(wǎng)站做的自己做網(wǎng)站如何賺錢
  • 站長網(wǎng)站提交職業(yè)技能培訓(xùn)平臺
  • seo優(yōu)化方向浙江seo推廣
  • 網(wǎng)站直播是未開票收入怎么做信息流廣告推廣
  • 網(wǎng)上購物商城er圖楓林seo工具
  • php網(wǎng)站開發(fā)實戰(zhàn)教程谷歌瀏覽器下載手機版
  • 網(wǎng)站驗證錢的分錄怎么做百度競價開戶
  • 佛山抖音seo茶葉seo網(wǎng)站推廣與優(yōu)化方案
  • 企通互聯(lián)的網(wǎng)站建設(shè)失敗互聯(lián)網(wǎng)宣傳方式有哪些
  • Java電商網(wǎng)站開發(fā)資源專業(yè)營銷策劃團隊
  • 營銷型企業(yè)網(wǎng)站模板重慶森林在線觀看
  • 網(wǎng)站建設(shè)項目評審意見搜狗收錄查詢
  • 做微商網(wǎng)站制作公司注冊
  • 免費下載建設(shè)銀行官方網(wǎng)站下載seo綜合查詢工具下載
  • 網(wǎng)站推銷話術(shù)seo搜索引擎招聘
  • 做黑枸杞的公司網(wǎng)站競價排名是什么
  • 適合學(xué)生做網(wǎng)頁練習(xí)的網(wǎng)站哪個杭州seo好
  • 自己的網(wǎng)站做一些誘惑新聞源發(fā)稿平臺
  • 做自己的第一個網(wǎng)站網(wǎng)站制作詳細流程
  • 如何做下載網(wǎng)站全渠道營銷案例
  • 衡陽網(wǎng)站建設(shè)公司設(shè)計公司企業(yè)網(wǎng)站
  • 寬帶套餐怎么辦理最劃算seo是什么意思為什么要做seo