一区二区三区三上|欧美在线视频五区|国产午夜无码在线观看视频|亚洲国产裸体网站|无码成年人影视|亚洲AV亚洲AV|成人开心激情五月|欧美性爱内射视频|超碰人人干人人上|一区二区无码三区亚洲人区久久精品

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

鴻蒙系統(tǒng)中制作demo特效組件

OpenHarmony技術(shù)社區(qū) ? 來(lái)源:鴻蒙技術(shù)社區(qū) ? 作者:木棉花潘穎琳 ? 2021-11-01 14:37 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

之前看到“粒子消散”的特效組件,于是就產(chǎn)生想法(自己也弄個(gè)特效組件應(yīng)該挺有意思的)。

這個(gè)煙花特效可以添加到游戲勝利的界面中,可能還有其他應(yīng)用場(chǎng)景哈哈。這也算是我做的第一個(gè)組件原創(chuàng) demo 啦!

有三種模式可以選擇,一種是圖案只有五角星,一種是圖案只有三角形,還有一種是圖案既有五角星又有三角星。顏色有 10 種,還有背景音樂(lè)(自己 DIY 的煙花音效)!話不多說(shuō),開整!

創(chuàng)建一個(gè)空白的工程

DevEco Studio 下載安裝成功后,打開 DevEco Studio,點(diǎn)擊左上角的 File,點(diǎn)擊 New,再選擇 New Project,選擇 Empty Ability。

然后點(diǎn)擊 Next,給項(xiàng)目命名 Framework,選擇設(shè)備類型 Phone,選擇語(yǔ)言類型 JS 最后點(diǎn)擊 Finish。

代碼刪除的部分如下:

在 entry>src>main>js>default>pages.index>index.hml 文件里把以下代碼刪掉:
class="title">
{{$t('strings.hello')}}{{title}}

在 entry>src>main>js>default>pages.index>index.js 文件里把以下代碼刪掉:

title:""
onInit(){
this.title=this.$t('strings.world');
}

在 entry>src>main>js>default>pages.index>index.css 文件里把 container 部分以下的代碼刪掉。

布局設(shè)計(jì)

①index.hml

該組件是畫布組件,畫布的大小是整個(gè)屏幕,而按鈕是顯示畫布上方的,所以要添加個(gè)棧組件,依次放入畫布組件和按鈕組件。

代碼如下,注意這里畫布組件添加了觸摸事件 touchstartfunc,下文會(huì)講解這步。

class="stack">
class="canvas"ref="canvas"@touchstart='touchstartfunc'>
"button"class="STAR"value="五角星"onclick="click_star"/>
"button"class="TRIANGLE"value="三角形"onclick="click_triangle"/>
"button"class="MIX"value="混合"onclick="click_mix"/>

②index.css

給畫布組件和按鈕組件設(shè)置屬性,代碼如下:

.canvas{
width:100%;
height:100%;
background-color:black;
}
.STAR{
width:80px;
height:38px;
font-size:20px;
background-color:blue;
border-color:blue;
text-color:aquamarine;
top:660px;
left:40px;
}
.TRIANGLE{
width:80px;
height:38px;
font-size:20px;
background-color:blue;
border-color:blue;
text-color:aquamarine;
top:660px;
left:150px;
}
.MIX{
width:80px;
height:38px;
font-size:20px;
background-color:blue;
border-color:blue;
text-color:aquamarine;
top:660px;
left:260px;
}

此時(shí)打開模擬器,你就能得到上面效果圖左 1 圖,接下來(lái)做功能實(shí)現(xiàn)部分。

繪制圖案

①五角星

函數(shù) draw_star 傳的參數(shù)分別是煙花釋放的圓心坐標(biāo),圖案的顏色,圖案移動(dòng)的斜率,圖案是否填充顏色。

定義的變量中,x 和 y 是圖案中心的坐標(biāo),根據(jù)時(shí)間推移(會(huì)設(shè)定定時(shí)器,下文會(huì)講)move_times 增加,圖案會(huì)沿著傳進(jìn)來(lái)的斜率方向作直線移動(dòng),以達(dá)到煙花綻放的效果。

變量 a-h 都是為了便于繪制五角星的圖案而設(shè)的公式參數(shù)值,全局變量 r_star 是五角星的邊長(zhǎng),最后根據(jù)公式去繪制單個(gè)五角星圖案。

index.js:先在 export default 上方定義變量。

varctx;
varmove_times=1;
varr_star=5;
varr_triangle=14;

然后在 export default 下方添加代碼:

onShow(){
ctx=this.$refs.canvas.getContext('2d');
},

draw_Star(x_1,y_1,color,x_2,y_2,fill){
letx=x_1+move_times*x_2;
lety=y_1+move_times*y_2;
leta=r_star*Math.sin(Math.PI/10);
letb=r_star*Math.cos(Math.PI/10);
letc=(r_star+a)*Math.tan(Math.PI/10);
letd=(r_star+a)*Math.tan(Math.PI/5)-c;
lete=r_star*Math.sin(Math.PI/5);
letf=r_star*Math.cos(Math.PI/5);
letg=(r_star+2*a)*Math.cos(2*Math.PI/5);
leth=(r_star+2*a)*Math.sin(2*Math.PI/5);

ctx.lineWidth=1;
ctx.beginPath();
ctx.moveTo(x-r_star-a,y-c);
ctx.lineTo(x-a,y-c);
ctx.lineTo(x,y-b-c);
ctx.lineTo(x+a,y-c);
ctx.lineTo(x+a+r_star,y-c);
ctx.lineTo(x+a+r_star-f,y+e-c);
ctx.lineTo(x+a+g,y+h-c);
ctx.lineTo(x,y+d);
ctx.lineTo(x-a-g,y+h-c);
ctx.lineTo(x-a-r_star+f,y+e-c);
ctx.closePath();
ctx.stroke();
move_times=move_times+1;
},

②三角星

同樣, draw_triangle 是繪制單個(gè)三角形并沿設(shè)定斜率移動(dòng)的函數(shù),函數(shù)的參數(shù)類型及作用與五角星的一致。

全局變量 r_triangle 為三角形的邊長(zhǎng),代碼如下:

draw_Triangle(x_1,y_1,color,x_2,y_2,fill){
letx=x_1+move_times*x_2;
lety=y_1+move_times*y_2;
ctx.lineWidth=1;
ctx.beginPath();
ctx.moveTo(x-r_triangle/2,y+Math.sqrt(3)*r_triangle/6);
ctx.lineTo(x,y-Math.sqrt(3)*r_triangle/3);
ctx.lineTo(x+r_triangle/2,y+Math.sqrt(3)*r_triangle/6);
ctx.closePath();
ctx.stroke();

move_times=move_times+1;
},

③圖案的美化

設(shè)置了 10 種顏色的顏色字典,通過(guò)繪制圖案函數(shù) draw 中的參數(shù) color 去控制顏色(黑色是作保護(hù)作用),顏色可通過(guò)單獨(dú)設(shè)置數(shù)字 1-10 來(lái)選擇,也可以通過(guò)隨機(jī)數(shù)(1~10)去隨機(jī)變化顏色。

顏色填充也是如此,1 為不填充,2 為填充,也可隨機(jī)產(chǎn)生 1 或 2 來(lái)隨機(jī)變化是否填充顏色。

vardrawcolors=[0,1,2,3,4,5,6,7,8,9,10];
constCOLORS={
"0":'black',
"1":"#FF2E10",
"2":"#FB8D15",
"3":"#F4ED1C",
"4":"#C5F31D",
"5":"#51F11F",
"6":"#18F8F8",
"7":"#1166FF",
"8":"#9833DD",
"9":"#FC14EB",
"10":"#C64A6A"
}

draw 函數(shù)中,在 ctx.lineWidth 下方,在 ctx.beginPath 上方添加代碼:

ctx.strokeStyle=COLORS[drawcolors[color].toString()];

在 ctx.stroke 下方添加代碼:

if(fill==2){
ctx.fillStyle=COLORS[drawcolors[color].toString()];
ctx.fill();
};

draw 開頭的函數(shù)是繪制單個(gè)圖案,接下來(lái)的 Draw 函數(shù)是繪制 8 個(gè)或 10 個(gè)圖案圍成圓形向外同速率擴(kuò)展的圖像,run 開頭的函數(shù)是被循環(huán)的函數(shù)。

繪制煙花

①煙花的布局

綻放的煙花的形狀是一個(gè)圓形,火花為單個(gè)圖案。我設(shè)計(jì)了兩種煙花綻放數(shù)量,一種是一個(gè)圓中有 8 個(gè)圖案的,一種是一個(gè)圓中有 10 個(gè)圖案的。

它們的斜率都通過(guò)數(shù)學(xué)公式定義好了(如下的全局變量所示),單個(gè)圖案沿斜率方向每次移動(dòng)的距離為全局變量 R 的數(shù)值。

varR=0.25;
vars=R*Math.cos(Math.PI/5);
vart=R*Math.sin(Math.PI/5);
varv=R*Math.cos(Math.PI/2.5);
varw=R*Math.sin(Math.PI/2.5);

Draw_Star_8(click_x,click_y){
this.draw_Star(click_x,click_y,1,-R,0,Math.floor(Math.random()*2+1));
this.draw_Star(click_x,click_y,2,-R/Math.sqrt(2),-R/Math.sqrt(2),Math.floor(Math.random()*2+1));
this.draw_Star(click_x,click_y,3,0,-R,Math.floor(Math.random()*2+1));
this.draw_Star(click_x,click_y,4,R/Math.sqrt(2),-R/Math.sqrt(2),Math.floor(Math.random()*2+1));
this.draw_Star(click_x,click_y,5,R,0,Math.floor(Math.random()*2+1));
this.draw_Star(click_x,click_y,6,R/Math.sqrt(2),R/Math.sqrt(2),Math.floor(Math.random()*2+1));
this.draw_Star(click_x,click_y,7,0,R,Math.floor(Math.random()*2+1));
this.draw_Star(click_x,click_y,8,-R/Math.sqrt(2),R/Math.sqrt(2),Math.floor(Math.random()*2+1));
},

Draw_Star_10(click_x,click_y,fill){
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),-R,0,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),-s,-t,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),-v,-w,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),v,-w,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),s,-t,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),R,0,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),s,t,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),v,w,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),-v,w,fill);
this.draw_Star(click_x,click_y,Math.floor(Math.random()*10+1),-s,t,fill);
},

Draw_Triangle_8(click_x,click_y,fill){
this.draw_Triangle(click_x,click_y,Math.floor(Math.random()*10+1),-R,0,fill);
this.draw_Triangle(click_x,click_y,Math.floor(Math.random()*10+1),-R/Math.sqrt(2),-R/Math.sqrt(2),fill);
this.draw_Triangle(click_x,click_y,Math.floor(Math.random()*10+1),0,-R,fill);
this.draw_Triangle(click_x,click_y,Math.floor(Math.random()*10+1),R/Math.sqrt(2),-R/Math.sqrt(2),fill);
this.draw_Triangle(click_x,click_y,Math.floor(Math.random()*10+1),R,0,fill);
this.draw_Triangle(click_x,click_y,Math.floor(Math.random()*10+1),R/Math.sqrt(2),R/Math.sqrt(2),fill);
this.draw_Triangle(click_x,click_y,Math.floor(Math.random()*10+1),0,R,fill);
this.draw_Triangle(click_x,click_y,Math.floor(Math.random()*10+1),-R/Math.sqrt(2),R/Math.sqrt(2),fill);
},

Draw_Triangle_10(click_x,click_y){
this.draw_Triangle(click_x,click_y,1,-R,0,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,2,-s,-t,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,3,-v,-w,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,4,v,-w,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,5,s,-t,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,6,R,0,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,7,s,t,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,8,v,w,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,9,-v,w,Math.floor(Math.random()*2+1));
this.draw_Triangle(click_x,click_y,10,-s,t,Math.floor(Math.random()*2+1));
},

②火花的移動(dòng)

上述提過(guò)一個(gè) movetimes,火花的移動(dòng)無(wú)非就是坐標(biāo)的變化,通過(guò)設(shè)置一個(gè)定時(shí)器,循環(huán)繪制圖案就能實(shí)現(xiàn)移動(dòng)的效果,先構(gòu)造一個(gè)被循環(huán)的函數(shù) run_star(舉五角星的實(shí)例,三角形同理;位置,美化等的參數(shù)隨意)。

代碼如下:

run_star(){
this.Draw_Star_10(200,300,1);
this.Draw_Star_10(150,200,2);
this.Draw_Star_8(300,218);
this.Draw_Star_8(110,380);
},

然后添加定時(shí)器:

vartimer_star=null;
vartimer_triangle=null;
vartimer_mix=null;

點(diǎn)擊按鈕“五角星”時(shí)會(huì)釋放圖案為五角星的煙花:

click_star(){
timer_star=setInterval(this.run_star,120);
},

此時(shí),打開模擬器,你會(huì)看到圖案移動(dòng)了,但上一個(gè)圖案沒(méi)有清除:

05b09e9a-3ac5-11ec-82a9-dac502259ad0.png

所以要給被循環(huán)的函數(shù)添加一個(gè)清空操作(為了保護(hù)清空函數(shù),要先在清空前加點(diǎn)東西),在 this.Draw 函數(shù)之前添加以下代碼:

this.draw_Star(0,0,0,0,0,0);
ctx.clearRect(0,0,400,800);

③煙花的結(jié)束

按上述步驟下來(lái),會(huì)發(fā)現(xiàn)煙花的圓形越來(lái)越大,最終出界。為了實(shí)現(xiàn)煙花的結(jié)束,可以根據(jù) movetimes 的增加次數(shù)來(lái)控制煙花綻放范圍的大小。

通過(guò)透明度的遞減,最終透明度減為 0,圖案消失:

varo=1;

在 draw 函數(shù)里的開頭位置添加以下代碼:

if((move_times>=230&&move_times<=330)){
o=o-0.01;
ctx.globalAlpha=o;
};

④煙花的循環(huán)綻放

在 draw 函數(shù)里的開頭位置添加以下代碼:

if(move_times==342){
o=1;
ctx.globalAlpha=o;
move_times=1;
};

同理可以設(shè)置“三角形”和“混合”的被循環(huán)函數(shù):

run_triangle(){
this.draw_Triangle(0,0,0,0,0,0);
ctx.clearRect(0,0,400,800);
this.Draw_Triangle_8(200,300,1);
this.Draw_Triangle_8(150,200,2);
this.Draw_Triangle_10(300,218);
this.Draw_Triangle_10(110,380);
},

run_mix(){
this.draw_Triangle(0,0,0,0,0,0);
ctx.clearRect(0,0,400,800);
this.Draw_Triangle_8(200,300,1);
this.Draw_Star_10(150,200,2);
this.Draw_Triangle_10(300,218);
this.Draw_Star_8(110,380);
},

點(diǎn)擊處綻放煙花

先獲取點(diǎn)擊處相對(duì)于畫布組件左上角的坐標(biāo),然后作為新煙花綻放的圓心坐標(biāo)傳參,這里的 click_b1,click_b2 下文會(huì)講解。

vartimer_click=null;
run_touch(){
if(click_b2==true){
this.draw_Star(x,y,0,0,0);
ctx.clearRect(0,0,400,800);
this.Draw_Star_10(x,y,1);
}
},

touchstartfunc(msg){
click_b1==true;
x=msg.touches[0].globalX;
y=msg.touches[0].globalY;
if(click_b1==true){
timer_click=setInterval(this.run_touch,120);
click_b1=false;
timer_click=null;
}
},

煙花圖案的切換

通過(guò)設(shè)定布爾型變量來(lái)控制點(diǎn)擊另一個(gè)按鈕時(shí),清空上一個(gè)按鈕運(yùn)行的定時(shí)器。

varstar_b=true;
varmix_b=true;
vartriangle_b=true;
varclick_b1=true;
varclick_b2=true;

click_star(){
click_b2=false;
clearInterval(timer_triangle);
timer_triangle=null;
clearInterval(timer_mix);
timer_mix=null;
ctx.clearRect(0,0,400,800);
if(star_b==true){
timer_star=setInterval(this.run_star,120);
star_b=false;
}
triangle_b=true;
mix_b=true;
},

click_triangle(){
click_b2=false;
clearInterval(timer_star);
timer_star=null;
clearInterval(timer_mix);
timer_mix=null;
ctx.clearRect(0,0,400,800);
if(triangle_b==true){
timer_triangle=setInterval(this.run_triangle,120);
triangle_b=false;
}
star_b=true;
mix_b=true;
},

click_mix(){
click_b2=false;
clearInterval(timer_star);
timer_star=null;
clearInterval(timer_triangle);
timer_triangle=null;
ctx.clearRect(0,0,400,800);
if(mix_b==true){
timer_mix=setInterval(this.run_mix,120);
mix_b=false;
}
star_b=true;
triangle_b=true;
},

背景音樂(lè)的添加

js 模板中添加音頻可以去看我之前的文章:

https://harmonyos.51cto.com/posts/7802

index.hml:

<videoid='videoId'
src='/common/flr_5_1.mp3'
autoplay='true'
controls="false"
onfinish='finishCallback'>video>

index.js:

varvideo_b=true;

在 src/common/ 下加入音頻文件:

finishCallback:function(){
if(video_b==true){
this.$element('videoId').start();
}
},

別忘了生命周期的設(shè)置,在應(yīng)用啟動(dòng)時(shí)自動(dòng)播放音頻,在應(yīng)用隱藏的時(shí)候暫停播放音頻并清空所有定時(shí)器,在應(yīng)用銷毀時(shí)清空所有定時(shí)器,停止播放音頻。

onShow(){
ctx=this.$refs.canvas.getContext('2d');
this.$element('videoId').start();
},

onHide(){
clearInterval(timer_star);
timer_star=null;
clearInterval(timer_triangle);
timer_triangle=null;
clearInterval(timer_mix);
timer_mix=null;
clearInterval(timer_click);
timer_click=null;
video_b=false;
this.$element('videoId').pause();
},

onDestroy(){
clearInterval(timer_star);
timer_star=null;
clearInterval(timer_triangle);
timer_triangle=null;
clearInterval(timer_mix);
timer_mix=null;
clearInterval(timer_click);
timer_click=null;
video_b=false;
this.$element('videoId').pause();
},

結(jié)語(yǔ)

以上就是我這次的小分享啦!自己的第一個(gè) demo 開發(fā),略微粗糙!更多資料請(qǐng)關(guān)注我們的項(xiàng)目 :Awesome-Harmony_木棉花。

https://gitee.com/hiharmonica/awesome-harmony-os-kapok

點(diǎn)擊關(guān)注鴻蒙技術(shù)社區(qū)了解鴻蒙一手資訊 06343b4c-3ac5-11ec-82a9-dac502259ad0.gif

求分享

06343b4c-3ac5-11ec-82a9-dac502259ad0.gif

求點(diǎn)贊

06343b4c-3ac5-11ec-82a9-dac502259ad0.gif

求在看


原文標(biāo)題:我做的第一款鴻蒙demo!

文章出處:【微信公眾號(hào):HarmonyOS技術(shù)社區(qū)】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。


聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場(chǎng)。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問(wèn)題,請(qǐng)聯(lián)系本站處理。 舉報(bào)投訴
  • 操作系統(tǒng)
    +關(guān)注

    關(guān)注

    37

    文章

    7144

    瀏覽量

    125565
  • 鴻蒙系統(tǒng)
    +關(guān)注

    關(guān)注

    183

    文章

    2642

    瀏覽量

    68076
  • HarmonyOS
    +關(guān)注

    關(guān)注

    80

    文章

    2126

    瀏覽量

    32999

原文標(biāo)題:我做的第一款鴻蒙demo!

文章出處:【微信號(hào):gh_834c4b3d87fe,微信公眾號(hào):OpenHarmony技術(shù)社區(qū)】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。

收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評(píng)論

    相關(guān)推薦
    熱點(diǎn)推薦

    【HarmonyOS 5】鴻蒙頁(yè)面和組件生命周期函數(shù)

    【HarmonyOS 5】鴻蒙頁(yè)面和組件生命周期函數(shù) ##鴻蒙開發(fā)能力 ##HarmonyOS SDK應(yīng)用服務(wù)##鴻蒙金融類應(yīng)用 (金融理財(cái)# 一、生命周期階段: 創(chuàng)建階段 build
    的頭像 發(fā)表于 07-11 18:24 ?275次閱讀

    【HarmonyOS 5】金融應(yīng)用開發(fā)鴻蒙組件實(shí)踐

    【HarmonyOS 5】金融應(yīng)用開發(fā)鴻蒙組件實(shí)踐 ##鴻蒙開發(fā)能力 ##HarmonyOS SDK應(yīng)用服務(wù)##鴻蒙金融類應(yīng)用 (金融理財(cái)# 一、
    的頭像 發(fā)表于 07-11 18:20 ?276次閱讀
    【HarmonyOS 5】金融應(yīng)用開發(fā)<b class='flag-5'>鴻蒙</b><b class='flag-5'>組件</b>實(shí)踐

    飛書開源“RTV”富文本組件 重塑鴻蒙應(yīng)用富文本渲染體驗(yàn)

    近日,飛書正式將其自研的富文本組件庫(kù)?RichTextVista(簡(jiǎn)稱“RTV”)開源,并上線OpenHarmony?三方庫(kù)中心倉(cāng)。該組件以領(lǐng)先的性能、流暢的渲染體驗(yàn)與高度的開放性,為鴻蒙生態(tài)提供了
    的頭像 發(fā)表于 07-11 15:20 ?94次閱讀
    飛書開源“RTV”富文本<b class='flag-5'>組件</b> 重塑<b class='flag-5'>鴻蒙</b>應(yīng)用富文本渲染體驗(yàn)

    鴻蒙Stage模型與FA模型詳解

    【HarmonyOS 5】鴻蒙Stage模型與FA模型詳解 ##鴻蒙開發(fā)能力 ##HarmonyOS SDK應(yīng)用服務(wù)##鴻蒙金融類應(yīng)用 (金融理財(cái)# 一、前言 在HarmonyOS
    的頭像 發(fā)表于 07-07 11:50 ?158次閱讀

    【HarmonyOS 5】鴻蒙的UIAbility詳解(三)

    【HarmonyOS 5】鴻蒙的UIAbility詳解(三) ##鴻蒙開發(fā)能力 ##HarmonyOS SDK應(yīng)用服務(wù)##鴻蒙金融類應(yīng)用 (金融理財(cái)# 一、前言 本文是
    的頭像 發(fā)表于 06-14 22:32 ?38次閱讀

    鴻蒙Next實(shí)現(xiàn)瀑布流布局

    設(shè)計(jì)思路 鴻蒙 Next 的瀑布流布局可以通過(guò)自定義組件結(jié)合 Column、Row 等容器組件實(shí)現(xiàn)。其核心思路是將數(shù)據(jù)分成若干列,每列獨(dú)立滾動(dòng)展示,且根據(jù)數(shù)據(jù)項(xiàng)高度動(dòng)態(tài)調(diào)整布局,以達(dá)到類似瀑布自然流動(dòng)
    發(fā)表于 06-10 14:17

    HarmonyOS實(shí)戰(zhàn):組件化項(xiàng)目搭建

    前言 鴻蒙應(yīng)用開發(fā)已經(jīng)成為互聯(lián)網(wǎng)新的風(fēng)口,開發(fā)鴻蒙軟件已經(jīng)成為今年工作的核心目標(biāo)。在軟件開發(fā)過(guò)程,對(duì)于復(fù)雜度較大,功能較多的軟件都會(huì)采用組件化項(xiàng)目架構(gòu),那么對(duì)于
    的頭像 發(fā)表于 06-09 14:58 ?206次閱讀
    HarmonyOS實(shí)戰(zhàn):<b class='flag-5'>組件</b>化項(xiàng)目搭建

    Kuikly鴻蒙版正式開源 —— 揭秘卓越性能適配之旅

    、系統(tǒng)化工作,同時(shí)為了達(dá)到高性能、原生渲染、動(dòng)態(tài)化等適配目標(biāo),進(jìn)行了持續(xù)的探索和優(yōu)化。其核心適配工作包括:對(duì)接鴻蒙UI系統(tǒng),封裝原子組件,對(duì)接事件
    發(fā)表于 06-04 16:46

    鴻蒙5開發(fā)寶藏案例分享---一多開發(fā)實(shí)例(游戲)

    :\"用戶換手機(jī)后寵物數(shù)據(jù)全丟了怎么辦?\"鴻蒙的****分布式數(shù)據(jù)對(duì)象簡(jiǎn)直就是為這種場(chǎng)景量身定制的! 案例通過(guò)三個(gè)關(guān)鍵步驟實(shí)現(xiàn)無(wú)縫同步: 定義共享數(shù)據(jù)模型(寵物屬性+成長(zhǎng)值) 設(shè)置
    發(fā)表于 06-03 18:22

    開源啦?。?!基于鴻蒙ArkTS封裝的圖表組件《McCharts》,大家快來(lái)一起共創(chuàng)

    的地方請(qǐng)大家高抬貴手,寬容一下,謝謝。 這次主要是給大家?guī)?lái)一個(gè)重磅消息,就是我自己使用鴻蒙ArkTS語(yǔ)法開發(fā)的圖表組件今日正式開源了。為什么?原因有兩點(diǎn)吧! 鴻蒙是國(guó)產(chǎn)的操作系統(tǒng),
    發(fā)表于 03-15 15:21

    AIGC入門及鴻蒙入門

    JDK、配置SDK等。 3. 開發(fā)實(shí)踐: 學(xué)習(xí)鴻蒙系統(tǒng)的架構(gòu)和API,了解其組件化、分布式等特性。 通過(guò)官方文檔和社區(qū)資源,學(xué)習(xí)和掌握鴻蒙應(yīng)用的開發(fā)流程和技巧。 總結(jié)來(lái)說(shuō),AIGC作為
    發(fā)表于 01-13 10:32

    鴻蒙原生頁(yè)面高性能解決方案上線OpenHarmony社區(qū) 助力打造高性能原生應(yīng)用

    高性能鴻蒙原生應(yīng)用。 Nodepool:優(yōu)化頁(yè)面滑動(dòng)流暢性Nodepool旨在解決應(yīng)用頁(yè)面滑動(dòng)卡頓問(wèn)題。開發(fā),相似頁(yè)面因業(yè)務(wù)和代碼差異,組件復(fù)用性差,引發(fā)卡頓、丟幀,影響用戶體驗(yàn)。Nodepool通過(guò)
    發(fā)表于 01-02 18:00

    鴻蒙Flutter實(shí)戰(zhàn):14-現(xiàn)有Flutter 項(xiàng)目支持鴻蒙 II

    引言 在之前的文章鴻蒙Flutter實(shí)戰(zhàn):09-現(xiàn)有Flutter項(xiàng)目支持鴻蒙,介紹了如何改造項(xiàng)目,適配鴻蒙平臺(tái)。 文中講述了整體的理念和思路,本文更進(jìn)一步,結(jié)合可實(shí)操的項(xiàng)目代碼,詳
    發(fā)表于 12-26 14:59

    鴻蒙原生開發(fā)手記:01-元服務(wù)開發(fā)

    簡(jiǎn)介 元服務(wù)是鴻蒙的一種輕量應(yīng)用形態(tài),無(wú)需下載,直接運(yùn)行。類似于微信小程序,但與小程序不同的是,元服務(wù)更加輕量。 元服務(wù)使用原生開發(fā),是系統(tǒng)級(jí)提供的,無(wú)論從易用性、性能、體驗(yàn)上,都要比小程序好
    發(fā)表于 11-14 17:28

    AIGC在視頻內(nèi)容制作的應(yīng)用前景

    AIGC技術(shù)能夠顯著縮短視頻內(nèi)容的制作周期。通過(guò)AI算法,可以快速生成視頻剪輯、特效、字幕和配樂(lè)等,減少人工操作的時(shí)間。例如,在短視頻制作,AIGC技術(shù)可以自動(dòng)找到最佳剪輯點(diǎn)、裁剪
    的頭像 發(fā)表于 10-25 15:44 ?1809次閱讀