Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex: Prevent scrollbar from covering content when automatically displayed

I have a canvas in Flex that shall be able only to be scrolled in vertical direction, so I set the attributes of the canvas as follows:

verticalScrollPolicy="auto" horizontalScrollPolicy="off"

The problem here is that the vertical scrollbar covers the content when it appears - altough there is enough horizontal room left. I would have expected that the content size would have been automatically adjusted.

When setting the vertical scroll policy to "on", no content is covered also.

In case I set both scroll policies to 'auto' I also get a horizontal scroll bar just for scrolling to the area that is covered by the vertical scroll bar.

Is there a workaround how I can relayout the content of the canvas when the vertical scroll bar is shown so that it does not cover any content?

like image 420
Yaba Avatar asked Nov 15 '08 17:11

Yaba


2 Answers

It's a bug. See Flex verticalScrollPolicy bug for a workaround.

like image 143
Scott Evernden Avatar answered Oct 18 '22 22:10

Scott Evernden


Just a side note regarding this issue: it's actually not a bug, but known (and intended?) behaviour:

"Flex considers scroll bars in its sizing calculations only if you explicitly set the scroll policy to ScrollPolicy.ON. So, if you use an auto scroll policy (the default), the scroll bar overlaps the buttons. To prevent this behavior, you can set the height property for the HBox container or allow the HBox container to resize by setting a percentage-based width. Remember that changing the height of the HBox container causes other components in your application to move and resize according to their own sizing rules."

-- From Sizing Components in the Flex 3 help, under "Using Scroll bars"

like image 40
hasseg Avatar answered Oct 18 '22 21:10

hasseg