Flex 中动态渲染组件上的滚动条
我正在尝试显示我在面板内制作的自定义组件,但是当它呈现时,内容显示在面板框之外,并且没有滚动条。
在设计师中我有这个: https://i.sstatic.net/V99pG.jpg
- 面板
- 是 myComponent 的实例面板上有
- 一个按钮,该按钮调用 myComponent 上的方法,该方法向其中添加一些控件
当我运行应用程序并按下按钮时,将显示以下内容: https://i.sstatic.net/wlDnV.jpg
看到myComponent中动态添加的控件越过面板的底线,而不是仅显示组件的可见部分和滚动条。
有什么想法如何修复它吗? 谢谢!
I'm trying to display a custom component i made inside a panel but when it renders the content is displayed outside of the panel box and there's no scrollbar.
In the designer i have this:
https://i.sstatic.net/V99pG.jpg
- a panel
- an instance of myComponent inside the panel
- a button that calls a method on myComponent that adds some controls into it
When i run the application and press the button the following is displayed:
https://i.sstatic.net/wlDnV.jpg
See that the controls added dynamically in myComponent get over the panel's bottom line instead of showing only the visible part of the component and a scrollbar.
Any ideas how to fix it?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在组件中使用文本区域来显示文本,则应该根据面板修复组件自定义组件高度,那么您应该调整文本区域大小
You should fix your component custom component height according to your panel if you are using text area in your component for displaying text then you should the text area size
我遇到了你的问题。事实证明,这与高度设置有关。显然,将高度设置为 100% 会使事情变得混乱。
我有一个手风琴、手风琴内的(几个)NavigatorContent、导航器内容内的面板、面板内的滚动器,其中滚动器的视口设置为在所有这些之外声明的 VGroup。 VGroup 将
clipAndEnableScrolling
设置为 true。在 VGroup 内,我有一个表单,可以在其中动态添加单选按钮,并且我的单选按钮会从屏幕上消失。将 VGroup 的高度设置为导航器内容的高度解决了我的问题。然后,我必须将 VGroup 的宽度设置为 Navigator Content -17 的宽度,以补偿滚动条本身的宽度。
这是引导我走向正确方向的链接。
http://www.actionscript.org/forums/showthread.php3 ?mode=hybrid&t=191108
I had your problem exactly gigkent. Turns out that it's to do with height settings. Apparently, setting the height to 100% is what messes it up.
I had an Accordion, a (several) NavigatorContent inside the accordion, a panel inside the navigator content, a scroller inside the panel with the scroller's viewport set to a VGroup declared outside all of that. The VGroup had
clipAndEnableScrolling
set to true.Inside the VGroup, I had a form where I was dynamically adding radio buttons and my radio buttons were going off the screen. Setting the height of the VGroup to the height of the navigator content fixed the problem for me. I then had to set the width of the VGroup to the width of the Navigator Content -17 to compensate for the width of the scrollbar itself.
Here's the link that led me in the right direction.
http://www.actionscript.org/forums/showthread.php3?mode=hybrid&t=191108