检测是否UIComponent具有滚动条活跃 [英] Detecting if UIComponent has scroll bars active
本文介绍了检测是否UIComponent具有滚动条活跃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Flex中TileList和需要能够检测如果滚动条显示与否,这样我就可以改变它奠定了项目的大小。
I have a TileList in flex, and need to be able to detect if the scroll bars are shown or not, so I can change the size of the items it is laying out.
ScrollPolicy设置为auto,但我需要一个像CurrentScrollPolicy一个变量,它会从截止到更改取决于内容。
ScrollPolicy is set to auto, but I need a variable like CurrentScrollPolicy which will change from off to on depending on the content.
感谢
推荐答案
感谢eBuildy,你的权利!
Thanks eBuildy, your right!
我已经创建了一个例子,也考虑到滚动条让隐藏在不需要的时候,而不是重新设置为空的事实:
I have created an example that also takes into account the fact that scroll bars get hidden when not needed rather than set back to null:
public class CustomTileList extends TileList
{
public function CustomTileList()
{
super();
}
/**
* Returns true if the vertical scroll bar is displayed
* @return Boolean
*
*/
public function hasVerticalScrollBar():Boolean
{
if (super.verticalScrollBar == null || super.verticalScrollBar.visible == false)
return false;
return true;
}
}
感谢您的帮助。
Thanks for the help.
这篇关于检测是否UIComponent具有滚动条活跃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文