divya
divya

Reputation: 81

Scrollbar in flex only when needed?

I want to set horizontalScrollPolicy = ScrollPolicy.ON; only when my content exceeds the stage. If my stage width= 400 that can bear only two videocontainer, so the third video is cut off in stage. To avoid this, i put the code like this if(no of video container > 2){ horizontalScrollPolicy = ScrollPolicy.ON; } else{ horizontalScrollPolicy = ScrollPolicy.OFF; } The above logic works for me. But what i need is: when the video containers exceed for any stage width, the scroll should come..Otherwise it should in OFF state. How to achieve this? Nothing works till now. Anybody please help me ....

Upvotes: 0

Views: 91

Answers (1)

Max Golovanchuk
Max Golovanchuk

Reputation: 747

Try

ScrollPolicy.AUTO

ScrollPolicy.AUTO ("auto") - the scroll bar is displayed when the viewport's contentWidth is larger than its width.

Upvotes: 1

Related Questions