第一步:新建图片数组Stateswiperimgs:Array[$r('app.media.a'),本地图片或者网络图片$r('app.media.b'),$r('app.media.c'),$r('app.media.d')]第二步:写入轮播图代码Column(){Swiper(){ForEach(this.swiperimgs,(item){Image(item).width('90%').height(180).borderRadius(25)})}.borderRadius(25).autoPlay(true).indicator(false).itemSpace(10).onChange((index:number){console.info('当前的是:',index.toString())})}.width('100%').borderRadius(25).margin({top:30})
2024-02-13 20:25:44 4701浏览 0点赞 0回复 0收藏
第一步:导入importpromptActionfrom'ohos.promptAction'第二步:在build下方写入pageTransition(){PageTransitionEnter({duration:1200}).slide(SlideEffect.Right)PageTransitionExit({delay:100}).translate({x:100.0,y:100.0}).opacity(0)}参考PageTransitionEnter参数:参数名类型必填说明valuePageTransitionOptions是配置入场动效的参数。PageTransitionExit参数:参数名类型必填说明valuePageTransitionOptions是配...
2024-02-12 13:53:24 4996浏览 0点赞 0回复 0收藏
2024-02-09 15:45:54 3086浏览 0点赞 0回复 0收藏
预览效果部分代码开发语言HarmonyOS鸿蒙ArkTS语言(Stage模型)备注一键生成,自带证件照数集,为开发者带来二次开发和学习体验,在这祝福开发者们使用愉快。使用方法下载后通过DevEcoStudio开发工具打开即可。下载地址[点击跳转下载页面(点击)一](https:mall.bilibili.comneulnextindex.htmlpagemallupitemDetail&noTitleBar1&itemsId1104487092&fromitemsshare&msourceitemsshare)[点击跳转下载页面(点击)二](https:download.csdn.netdownloadweixin5422605388809153)
2024-02-05 09:55:38 2558浏览 1点赞 0回复 0收藏
letarr[1,2,3,4,5];lettarget3;letresultarr.filter(itemitemtarget);letaString(result)将数字转换成文本型console.log(a);再次感谢您的阅读和支持!最诚挚的问候,“特创码农”
2024-01-31 22:19:59 7680浏览 0点赞 1回复 0收藏
EntryComponentstructPage{Statecolor:ColorColor.Blue;build(){Column({space:20}){Button('弹窗').width(180).height(80).backgroundColor(this.color).onClick((){AlertDialog.show({title:'弹窗标题',message:'弹窗内容',autoCancel:true,alignment:DialogAlignment.Default,offset:{dx:0,dy:20},gridCount:3,primaryButton:({value:'返回',fontColor:Color.Black,backgroundColor:Color.Orange,action:(){console.log("回...
2024-01-27 19:03:18 3241浏览 0点赞 0回复 0收藏
EntryComponentstructPage{StatescreenX:number0StatescreenY:number0StateX:number0StateY:number0Statetimestamp:number0build(){Row(){Column(){Text('应用窗口左上角的X坐标:'+this.screenX).fontColor(Color.White).margin({bottom:20})Text('应用窗口左上角的Y坐标:'+this.screenY).fontColor(Color.White).margin({bottom:20})Text('被点击元素左上角的X坐标:'+this.X).fontColor(Color.White).margin({bottom:20})Text(...
2024-01-23 21:53:20 2827浏览 0点赞 0回复 0收藏
EntryComponentstructIndex{StateAx:number0StateAxx:number260StateAy:number290onPageShow():void{animateTo({duration:2000,iterations:1,curve:Curve.Linear,playMode:PlayMode.Alternate},(){this.Ax260this.Axx0this.Ay600})}build(){Column(){向右滑动Column(){}.width(100).height(100).backgroundColor('ffc44f4f').position({x:this.Ax,y:0})Text('向右滑动').fontSize(20).fontWeight(FontWeight.Bold).margin({bott...
2024-01-21 15:43:35 2987浏览 0点赞 0回复 0收藏
EntryComponentstructIndex{StatewidthA:number200StateheightA:number200StateangleA:number0onPageShow():void{animateTo({duration:2000,iterations:1,curve:Curve.Linear},(){this.widthA0this.heightA0this.angleA360})}build(){Column(){中心旋转Column(){}.width(200).height(200).backgroundColor('ffc44f4f').rotate({x:0,y:0,z:1,angle:this.angleA,centerX:100,centerY:100,})Text('中心旋转').fontSize(20).fontWei...
2024-01-21 15:40:46 3230浏览 0点赞 0回复 0收藏
EntryComponentstructIndex{StatewidthA:number0StateheightA:number0onPageShow():void{animateTo({duration:2000,iterations:1,curve:Curve.Linear},(){this.widthA200this.heightA200})}build(){Column(){中心扩展Column(){}.width(this.widthA).height(this.heightA).backgroundColor('ffc44f4f')Text('中心扩展').fontSize(20).fontWeight(FontWeight.Bold).margin({bottom:10,top:10})向下扩展Column(){}.width(200).heig...
2024-01-20 21:50:55 2033浏览 0点赞 0回复 0收藏
EntryComponentstructIndex{StatewidthA:number200StateheightA:number200onPageShow():void{animateTo({duration:2000,iterations:1,curve:Curve.Linear},(){this.widthA0this.heightA0})}build(){Column(){中心缩放Column(){}.width(this.widthA).height(this.heightA).backgroundColor('ffc44f4f')Text('中心缩放').fontSize(20).fontWeight(FontWeight.Bold).margin({bottom:10,top:10})顶部缩放Column(){}.width(200).heig...
2024-01-20 21:47:21 2509浏览 0点赞 0回复 0收藏
EntryComponentstructIndex{Statenum:number0StatenumZ:number100Statetwonum:number90StatetwonumZ:number90Statetreenum:number180StatetreenumZ:number90Stateformnum:number270StateformnumZ:number270onPageShow():void{console.log('页面触发')animateTo({duration:2000,iterations:1,curve:Curve.Linear},(){this.num360this.numZ470this.twonum450this.twonumZ470this.treenum480this.treenumZ450this.formnum610this.f...
2024-01-20 19:54:31 2643浏览 0点赞 0回复 0收藏
javascriptEntryComponentstructIndex{Statemessage:string'HelloWorld'Stateqidong:booleanfalseStatenum:number0onPageShow():void{this.qidongtrueconsole.log('页面触发',this.qidong)animateTo({duration:2000,iterations:1,curve:Curve.Linear},(){this.num360})}build(){Row(){Stack({alignContent:Alignment.Center}){重叠居中最外层的圈Column(){}.width(150).height(150).backgroundColor('rgba(0,0,0,0)').opacity(0...
2024-01-17 12:49:54 2349浏览 0点赞 0回复 0收藏