Openharmony开发与入门----界面渲染
原创
·循环渲染(Foreach渲染)①接口描述:ForEach(arr:any[],itemGenerator:(item:any,index:number)void,keyGenerator:(item:any,index:number)string)②实例展示代码:EntryComponentstructMyComponent{Statearr:number[][10,20,30];build(){Column({space:5}){ForEach(this.arr,(item:number){Text(itemvalue:${item}).fontSize(18)Divider().strokeWidth(2)},(item:number)item.toString())}}}运行结果:③水果排行榜代码优化...