Text实现scroll效果怎么弄?
需要使用eTs实现text段落在固定height中可以有scroll效果。
Scroll(this.scroller) {
Column() {
Text("This text box is scrollable thanks to being situated inside a nested scroll view. That makes it scrollable regardless of the scrolling of the content of the entire screen, which can be scrolled independently.\nThe point here is to demonstrate how the over-scroll effect can work in the presence of nested scroll-views, provided it is applied over the parent (root) view, regardless of having inner nested scroll-views as children.\nIn this demo, the root view is merely a ScrollView, and therefore applying the effect over it is straightforward (i.e. using the OverScrollHelper).")
.width("100%").height("100%").textOverflow({ overflow: TextOverflow.None })
.fontSize(22).fontWeight(600).fontColor("#727171")
}.padding(14).width("100%").height(200)
}.scrollBar(BarState.Off)
上述代码子组件的height明显大于父组件,但是没有滚动效果。
鸿蒙
滚动
Text
赞
收藏 0
回答 1
待解决
相关问题
Mysql 同时修改多个库的数据怎么弄?
1065浏览 • 1回复 待解决
ability被异常杀后数据保留怎么弄?
3131浏览 • 1回复 待解决
这个arkts的顶部这个怎么弄呀,我只能显示下面那个弹窗,但是顶部那个不知道怎么弄,哪个大佬评论区指点下
127浏览 • 0回复 待解决
应用怎么实现半模态效果
264浏览 • 1回复 待解决
鸿蒙中怎么实现动画翻转效果
8322浏览 • 2回复 待解决
在子线程里面高刷调用canvas.drawPixelMapHolderRect;画图,然后模拟机闪退,请请帮帮忙怎么弄?
3660浏览 • 1回复 待解决
如何实现视频滤镜效果
278浏览 • 1回复 待解决
如何实现图中的卡片滑动效果?鸿蒙用什么组件能实现类似效果?
6696浏览 • 1回复 待解决
如何实现类似keyframes的效果
235浏览 • 1回复 待解决
文字动画效果如何实现
164浏览 • 0回复 待解决
scroll中嵌套一个或多个grid,如何实现嵌套滚动?
67浏览 • 0回复 待解决
List组件如何实现多列效果
137浏览 • 1回复 待解决
如何实现列表页的单选效果
440浏览 • 0回复 待解决
HarmonyOS自定义Text时,点击Text如何实现弹出软键盘的功能?
2221浏览 • 1回复 待解决
arkts 什么时候可以实现模糊效果
1239浏览 • 1回复 待解决
属性动画如何实现宽高动画效果
125浏览 • 1回复 待解决
text怎么更改部分文字颜色
5108浏览 • 1回复 待解决
Text怎么显示带html标签的文本
2473浏览 • 1回复 待解决
通过PolarDB的锁分析功能可以实现哪些效果?
921浏览 • 1回复 待解决
如何实现类似安卓协调布局CoordinateLayout的效果
147浏览 • 1回复 待解决
通过PolarDB的会话管理功能可以实现哪些效果?
1288浏览 • 1回复 待解决
如何实现拖拽时列表项占位动画的效果
268浏览 • 1回复 待解决
通过PolarDB的性能洞察功能可以实现哪些效果?
1213浏览 • 1回复 待解决
通过PolarDB的诊断报告功能可以实现哪些效果?
1244浏览 • 1回复 待解决
通过PolarDB的空间分析功能可以实现哪些效果?
851浏览 • 1回复 待解决
问题已解决,在外面再嵌套一层布局,设置height就行了