Spark Scroller,限制垂直滚动
我的视图中有一个 Spark Scroller,因为我有很多内容并且需要垂直滚动。我当前有一些标签从我的 dataProvider 获取数据,并且字符串有时很长。我希望标签是多行的,但由于当前所有内容都位于同时进行 x 和 y 滚动的 Scroller 中,因此标签从不使用 maxDisplayedLines 属性并将整个视口拉伸到所需的大小。
<s:Scroller left="10" right="10" top="10" bottom="0">
<s:Group>
<s:VGroup>
<s:HGroup>
<s:Label text="Name: "/>
<s:Label text="{data.name}"/>
</s:HGroup>
<s:HGroup>
<s:Label text="Description: "/>
<s:Label text="{data.description}" maxDisplayedLines="-1"/> // This pushes everything out, I want it to not expand the content horizontally beyond the width
</s:HGroup>
...
</s:VGroup>
</s:Group>
</s:Scroller>
任何帮助表示赞赏。谢谢。
I have a Spark Scroller within my View because I have a lot of content and require vertical scrolling. I current have some labels that get data from my dataProvider, and the strings are sometimes long. I'd like the label to be multiline, but because everything is currently in a Scroller that does both x and y scrolling, the label never uses the maxDisplayedLines property and stretches the entire viewport out to the required size.
<s:Scroller left="10" right="10" top="10" bottom="0">
<s:Group>
<s:VGroup>
<s:HGroup>
<s:Label text="Name: "/>
<s:Label text="{data.name}"/>
</s:HGroup>
<s:HGroup>
<s:Label text="Description: "/>
<s:Label text="{data.description}" maxDisplayedLines="-1"/> // This pushes everything out, I want it to not expand the content horizontally beyond the width
</s:HGroup>
...
</s:VGroup>
</s:Group>
</s:Scroller>
Any help is appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在容器/组件上确定宽度,以便一切都能正确测量。这对我有用:
You need to establish a width on your containers/components so it all measures properly. This worked for me:
使用horizontalScrollPolicy =“关闭”
Use horizontalScrollPolicy="off"