在List中,LazyForEach里面的ListItem在刷新的时候无法做动画嘛?同样一个动画,单独写就没有问题,但是放到ListLazyForEachListItem中没有任何动画效果,直接从0到1了
UI布局子控件超出父控件宽度,不知道是什么原因,想问下为什么子控件会超出父控件的宽度.clip这个参数是把子控件的内容裁掉了,会显示半个字的情况,我想要的是文本到达右侧宽度后自动换行的效果
build(){Navigation(){NavRouter(){NavDestination(){Text('page1')}.title("Page1")}NavRouter(){NavDestination(){Text('page2')}.title("Page2")}NavRouter(){NavDestination(){Text('page3')}.title("Page3")}}.title("NavigationTitle").titleMode(NavigationTitleMode.Mini).width('100%').height('100%').expandSafeArea([SafeAreaType.SYSTEM],[SafeAreaEdge.TOP,SafeAreaEdge.BOTTOM])}如何避开顶部状态栏和底部导航栏
使用了importbrightness,{BrightnessModeResponse,BrightnessResponse}from'system.brightness'获取和设置屏幕亮度,APP无法运行。
很多组件可以传入一个控制器controller去绑定这个组件,然后通过这个控制器controller来控制组件,例如TextArea({controller:this.textAreaController}),如果自己写个组件,实现这种传入控制器绑定应该怎么做?
Row(){Image($r('app.media.icmainsearch')).height(16).width(16).margin({left:12})}.margin({top:6,bottom:6,left:12,right:12,}).backgroundColor('FFFFFF').borderRadius(50).height(32).width('100%')如果我设置宽度为100%则左右边距失效,这种情况只能在外部套一层来实现么?
本来再简单不过的一个跳转,为什么就出现这样不可思议的问题呢?跳转之前参数man的length在log中都打印出来是1.为什么获取参数时候就是undefined?
build(){Column(){this.serverHeader('test')Grid(){ForEach(this.serverList,(item:string,index:number){GridItem(){Column(){Image('')Text(item)}}},(item:string,index:number)randomReuseIdentifier()+item+index)}.columnsTemplate('1fr1fr1fr1fr')this.serverHeader(‘test’)List(){ForEach(['1','2','3'],(item:string,index:number){ListItemGroup({header:this.serverType()}){ForEach(['2','3'],(item:string,inde...
画中画想回到某一个NavDestination,但是demo中包括文档都是返回到根navigation的id,如何返回到NavDestination
pathStack.popToIndex(count1,user)多级的时候,user是返回到上一级pushPathByName的地方,我popToIndex弹出多级,怎么在弹到的地方接受user参数。
自己写的组件对外抛出的事件,例如一个List组件的onItemSelect事件。如何通过像系统组件List(props).onXXX()这种方式组织事件呢,还是只能将事件回调通过属性传到组件里,文档中没有找到相关描述。
有个区域是隐藏的,点击按钮会显示这个区域,显示的时候加个特效,一点点从上往下展开if(this.item.isExpand){Column(){显示内容详情区域....}}
因为业务需求,a界面跳转到b界面并且关闭掉a界面,于是使用router.replaceUrl,页面跳转没有动画,如果添加一个过渡动画呢
xxx.etsimportComponentUtilsfrom'ohos.arkui.UIContext';ComponentexportstructTabsExample{StatecurrentIndex:number0StateanimationDuration:number300StateindicatorLeftMargin:number0StateindicatorWidth:number0privatetabsWidth:number0privatecomponentUtils:ComponentUtils.ComponentUtilsthis.getUIContext().getComponentUtils()BuildertabBuilder(index:number,name:string){Column(){Text(name).fontSize(16).fon...
在使用TextPicker并且传入数据range类型string[]绑定selected是没问题的但是range类型为TextCascadePickerRangeContent[]绑定selected绑定不上.是不支持吗还是我写法有问题privatedataList:string[]TextCascadePickerRangeContent[][]privateselect:numbernumber[][]TextPicker({range:this.dataList,selected:$$this.select}).textStyle({color:'rgba(51,51,51,0.5)',font:{size:14}}).selectedTextStyle({color:'333',font:{s...
如何更好的封装CustomDialogController?CustomDialogController如何脱离Component初始化?更好的减少耦合有没有规范且推荐的代码示例可以参考?
exportenumBAWStyle{White,Black}ComponentexportstructCaptureButton{PropbawStyle:BAWStyleBAWStyle.Whiteprivatesettings:RenderingContextSettingsnewRenderingContextSettings(true)privatecontext:CanvasRenderingContext2DnewCanvasRenderingContext2D(this.settings)build(){Canvas(this.context).width('100%').height('100%').backgroundColor('F5DC62').onReady((){this.onDraw()})}privateonDraw(){this.drawOuterC...
Slider({value:this.templatrue,min:34.5,max:43.1,style:SliderStyle.OutSet,step:0.1}).width('100%').margin({top:15,bottom:15}).onChange((value:number){console.debug('temptrue',${value})this.templatruevalue}).showTips(true,${this.templatrue})step设置为0.1,拖动的时候不是整的数,而是会出现35.70000076293945或者36.400001525878906,不是正常的35.1,35.2,35.3
Tabs和Swiper联合使用时候,Swiper滑动到最后一屏之后无法滑动到下一个tabContent页面或者左滑无法返回上一个页面操作步骤:Column(){Row({space:5}){ForEach(this.musicAblumDatas,(item:string,tabIndex:number){Text(item).fontSize(this.selectedIndextabIndex20:18).fontColor(this.selectedIndextabIndex"FF201E1E":Color.Black).onClick((){更新被选中的tabBar下标this.selectedIndextabIndex;})},(item:string)JSON.stri...
CustomDialogController封装成工厂方法时失效,以下方式dialog正常弹出:EntryComponentstructIndex{privateshareDialog:CustomDialogControllernewCustomDialogController({builder:ShareDialog(),alignment:DialogAlignment.Bottom,customStyle:true})privateshareDialog:CustomDialogControllerShareDialogControllerFactory.getShareDialogController()build(){Row(){Button("share").onClick((){this.shareDialog.open()})...
navPathStack.pushPath({name:name,param:param}),在跳转页面如何拿到param参数
我需要在屏幕上canvas绘制圆角矩形,查看了api,我应该是需要使用lineto、arcto进行绘制。但是发现arcto方法貌似并不按照我理解的进行绘制,能否给一段代码?
全栈若城 的精彩回答获得了0 赞同
wx662108d97e2cc 的精彩回答获得了0 赞同
hm673c38c974de6 的精彩回答获得了0 赞同
hm673c38c974de6 的精彩回答获得了0 赞同
hm673c38ebd6bf2 的精彩回答获得了0 赞同