I want to limit the height of the flexible component to the height of the browser viewport.
Component children are populated from the database table using a repeater and are basic flags. They are enough that the flex application ends about twice as high as the screen height, which means that part of the rest of the layout becomes crappy on me. How can I force the component that contains them to limit the size of the viewport?
Setting component heights to 100% should be all you need.
in mxml:
<mx:Vbox height="100% />
in actionscript:
myVBox.percentHeight = 100;
, , , . , , .
minHeight minWidth 0:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%"> <mx:HBox width="100%" height="100%"> <mx:HBox width="20%" height="100%"> <mx:Label text="Left Panel"/> </mx:HBox> <mx:VBox width="100%" height="100%" minWidth="0" minHeight="0"> <mx:CheckBox label="1" /> <mx:CheckBox label="2" /> <mx:CheckBox label="3" /> <mx:CheckBox label="4" /> <mx:CheckBox label="5" /> <mx:CheckBox label="6" /> <mx:CheckBox label="7" /> <mx:CheckBox label="8" /> <mx:CheckBox label="9" /> <mx:CheckBox label="10" /> <mx:CheckBox label="11" /> <mx:CheckBox label="12" /> <mx:CheckBox label="13" /> <mx:CheckBox label="14" /> <mx:CheckBox label="15" /> <mx:CheckBox label="16" /> <mx:CheckBox label="17" /> <mx:CheckBox label="18" /> <mx:CheckBox label="19" /> <mx:CheckBox label="20" /> </mx:VBox> <mx:HBox width="20%" height="100%"> <mx:Label text="Right Panel"/> </mx:HBox> </mx:HBox> </mx:Application>
, , Flex.
, Application.application.width Application.application.height
,
if (component.width > Application.application.width) component.width = Application.application.width
, , stage.addEventListener(Event.RESIZE, onStageResize)
stage.addEventListener(Event.RESIZE, onStageResize)
:
ActionScript:
component.height = viewport.height;
MXML:
<mx:component height={viewport.height} />
Source: https://habr.com/ru/post/1722505/More articles:Why does SQL Update Top seem to reduce locks even when no records are updated? - sqlA few PHP warnings in XSLTProcessor :: importStylesheet () - xmlsizeof (* this) in the header constructor implementation only - c ++What is a good and easy way to back up SVN repo to an FTP server? - svnHow to programmatically identify a file as a .NET assembly? - .netIn PowerPoint VBA, how to push all existing shapes in a window (not just one)? - setie7 and ie8 ignore "margin: 0px auto;" - internet-explorer-8Lazy stream for C # /. NET - c #SQL row not breaking rows in gridview - sql-serverПредварительно загружать изображения с помощью мыши в Rails - javascriptAll Articles