鴻蒙應(yīng)用開發(fā)案例實戰(zhàn)(ArkTS版)期末測試卷(四)參考答案_第1頁
鴻蒙應(yīng)用開發(fā)案例實戰(zhàn)(ArkTS版)期末測試卷(四)參考答案_第2頁
鴻蒙應(yīng)用開發(fā)案例實戰(zhàn)(ArkTS版)期末測試卷(四)參考答案_第3頁
鴻蒙應(yīng)用開發(fā)案例實戰(zhàn)(ArkTS版)期末測試卷(四)參考答案_第4頁
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

共15頁,第1頁HarmonyOS鴻蒙應(yīng)用開發(fā)期末測試卷(四)參考答案一、單選題(本題共20小題,滿分40分)1.C2.D3.A4.D5.C6.A7.B8.B9.A10.D11.D12.A13.C14.D15.A16.C17.A18.A19.B20.B二、填空題(本題共10小題,滿分20分)1.智能手機(jī);其他智能設(shè)備2.模擬器3.length4.public,private,protected5.實例化6.屏幕尺寸7.Row8.backgroundColor9.??10.resources三、判斷題(本題共10小題,滿分10分)1.√2.×3.√4.×5.×6.√7.×8.√9.×10.√四、編程題(本題共2小題,滿分20分)1.@Entry

@Component

structIndex{

@StatefontSize:number=20;

@StatefontStyle:string='normal'

build(){

Column(){

Text('HelloHarmonyOS')

.fontSize(this.fontSize)

.fontWeight(this.fontStyle=='normal'?FontWeight.Normal:FontWeight.Bold)

.margin({bottom:20})

Slider({

value:this.fontSize,

min:10,

max:40

})

.onChange((value:number)=>{

this.fontSize=value;

if(value>30){

this.fontStyle='bold';

}else{

this.fontStyle='normal';

}

})

}

.padding(20)

.width('100%')

.height('100%')

}

}

2.@Entry

@Component

structCounterPage{

@Statecount:number=0;

build(){

Column(){

Text(`Count:${this.count}`)

.fontSize(30)

Row(){

Button('-')

.onClick(()=>{

this.count--;

})

Button('+')

.onClick(()=>{

this.count++;

})

}

}

.width('100%')

.height('100%')

.justifyContent(FlexAlign.Center)

}

}五、簡答題(本題共1小題,滿分10分)1.interfaceMeiTuan{

title:string,

content:string,

time:string

}

@Entry

@Component

structIndex{

@Statemessages:Array<MeiTuan>=[

{title:'訂單通知',content:'您的訂單已送達(dá)',time:'10:00'},

{title:'優(yōu)惠活動',content:'新用戶立減20元',time:'09:30'},

{title:'系統(tǒng)公告',content:'App版本更新',time:'08:15'}

];

build(){

Column(){

List(){

ForEach(this.messages,(message:MeiTuan)=>{

ListItem(){

Column(){

Row(){

Text(message.title)

.fontSize(18)

.fontWeight(FontWeight.Bold)

Blank()

Text(message.time)

.fontSize(14)

.fontColor('#999999')

}

.width('100%')

.padding({bottom:8})

Text(message.content)

.fontSize(16)

.fontColor('#333333')

.width('100%')

.textAlign(TextAlign.Start)

}

.padding(16)

.backgroundColor('#FFFFFF')

.borderRadius(8)

.margin({bottom:8})

.width('100%')

}

.onClick(()=>{

AlertDialog.show({

title:message.title,

message:message.content,

autoCancel:true

});

})

})

}

.width

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論