- 浏览: 782383 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (360)
- Java (101)
- JPA/Hibernate (10)
- Spring (14)
- Flex/BlazeDS (37)
- Database (30)
- Lucene/Solr/Nutch (0)
- Maven/Ant (25)
- CXF/WebService (3)
- RPC/RMI/SOAP/WSDL (1)
- REST (6)
- TDD/BDD/JUnit (1)
- Servlet/JSP (2)
- AI/MachineLearning (3)
- Resource (1)
- 字符编码 (2)
- OOA/OOPS/UML (5)
- DesignPattern (8)
- 算法与数据结构 (11)
- Web&App Server (13)
- 并发&异步&无阻塞 (7)
- Entertainment (4)
- JavaScript/ExtJS (45)
- CodeStyle&Quality (1)
- svn/git/perforce (8)
- JSON (2)
- JavaScriptTesting (4)
- Others (6)
- RegularExpression (2)
- Linux/Windows (12)
- Protocal (2)
- Celebrities (1)
- Interview (1)
- 计算机语言 (1)
- English (2)
- Eclipse (5)
- TimeZone/时区 (1)
- Finance (1)
- 信息安全 (1)
- JMS/MQ (2)
- XSD/XML/DTD (3)
- Android (4)
- 投资 (3)
- Distribution (3)
- Excel (1)
最新评论
-
qdujunjie:
如果把m换成具体的数字,比如4或者5,会让读者更明白
m阶B树中“阶”的含义 -
java-admin:
不错,加油,多写点文章
关于Extjs的mixins和plugin -
xiehuaidong880827:
你好,我用sencha cmd打包完本地工程后,把app.js ...
ExtJS使用Sencha Cmd合并javascript文件为一个文件 -
KIWIFLY:
lwpan 写道inverse = "true&qu ...
Hibernate中什么时候使用inverse=true -
luedipiaofeng:
good
消除IE stop running this script弹出框
深红色部分标明了需注意的地方
另外要注意组件和容器的生命周期,确保你设置width和height是正确的时候,否则你设置了可能不发挥作用,可参考文章:http://help.adobe.com/en_US/flex/using/WS460ee381960520ad-2811830c121e9107ecb-7fff.html
http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_advanced_2.html
参考文档:http://livedocs.adobe.com/flex/3/html/help.html?content=size_position_3.html
Determining and controlling component sizes
Flex determines the sizes of controls and containers based on the components and their properties and how you can use Flex properties to control the sizes.
Note: For a summary of the basic rules for component sizing, see Basic layout rules and considerations.
Basic sizing property rules
The following rules describe how you can use Flex sizing properties to specify the size of a component:
■Any dimension property that you set overrides the corresponding default value; for example, an explicitly set height property overrides any default height.
■Setting the width, height, maxWidth, maxHeight, minWidth, or minHeight property to a pixel value in MXML or ActionScript also sets the corresponding explicit property, such as explicitHeight or explicitMinHeight.
■The explicit height and width and the percentage-based height and width are mutually exclusive. Setting one value sets the other to NaN; for example, if you set height or explicitHeight to 50 and then set percentHeight to 33, the value of the explicitHeight property is NaN, not 50, and the height property returns a value that is determined by the percentHeight setting.
■If you set the height or width property to a percentage value in an MXML tag, you actually set the percentage-based value, that is, the percentHeight or percentWidth property, not the explicit value. In ActionScript, you cannot set the height or width property to a percentage value; instead, you must set the percentHeight or percentWidth property.
■When you get the height and width properties, the value is always the actual height or width of the control.
Determining component size
During the measurement pass, Flex determines the components' default (also called measured) sizes. During the layout pass, Flex determines the actual sizes of the components, based on the explicit or default sizes and any percentage-based size specifications.
The following list describes sizing rules and behaviors that apply to all components, including both controls and containers. For container-specific sizing rules, see Determining container size. For detailed information on percentage-based sizing, see Using percentage-based sizing.
■If you specify an explicit size for any component (that is not outside the component's minimum or maximum bounds), Flex always uses that size.
■If you specify a percentage-based size for any component, Flex determines the component's actual size as part of the parent container's sizing procedure, based on the parent's size, the component's requested percentage, and the container-specific sizing and layout rules.
■The default and percentage-based sizes are always at least as large as any minimum size specifications.
■If you specify a component size by using a percentage value and do not specify an explicit or percentage-based size for its container, the component size is the default size. Flex ignores the percentage specification. (Otherwise, an infinite recursion might result.)
如果你只是给children设置了百分比值,但是对应的容器没有显示设置pixel值或百分比值,那么children使用的是其默认值,因为百分比值无法计算。
■If a child or set of children require more space than is available in the parent container, the parent clips the children at the parent's boundaries, and, by default, displays scroll bars on the container so users can scroll to the clipped content. Set the clipContent property to false to configure a parent to let the child extend past the parent's boundaries. Use the scrollPolicy property to control the display of the scroll bars.
■If you specify a percentage-based size for a component, Flex uses the viewable area of the container in determining the sizes.
■When sizing and positioning components, Flex does not distinguish between visible and invisible components. By default, an invisible component is sized and positioned as if it were visible. To prevent Flex from considering an invisible component when it sizes and positions other components, set the component's includeInLayout property to false. This property affects the layout of the children of all containers except Accordion, FormItem, or ViewStack. For more information, see Preventing layout of hidden controls.
Note: Setting a component's includeInLayout property to false does not prevent Flex from laying out or displaying the component; it only prevents Flex from considering the component when it lays out other components. As a result, the next component or components in the display list overlap the component. To prevent Flex from displaying the component, also set the visible property to false.
Determining container size
Flex uses the following basic rules, in addition to the basic component sizing rules, to determine the size of a container:
■Flex determines all components' default dimensions during the measurement pass, and uses these values when it calculates container size during the layout pass.
■If you specify an explicit size for a container, Flex always uses that size, as with any component.
■If you specify a percentage-based size for a container, Flex determines the container's actual size as part of the parent container's sizing procedure, as with any component.
■A percentage-based container size is advisory. Flex makes the container large enough to fit its children at their minimum sizes. For more information on percentage-based sizing, see Using percentage-based sizing.
■If you do not specify an explicit or percentage-based size for a container, Flex determines the container size by using explicit sizes that you specify for any of its children, and the default sizes for all other children.
■Flex does not consider any percentage-based settings of a container's children when sizing the container; instead, it uses the child's default size.
■If a container uses automatic scroll bars, Flex does not consider the size of the scroll bars when it determines the container's default size in its measurement pass. Thus, if a scroll bar is required, a default-sized container might be too small for proper appearance.
Each container has a set of rules that determines the container's default size. For information on default sizes of each control and container, see the specific container sections in the Adobe Flex Language Reference, and in Application Container; Using Layout Containers; and Using Navigator Containers.
深红色字体的部分需要特别注意,如果你没有给容器显示的设置pixel值或百分比的值,那么容器的宽度和高度是根据它的children的尺寸来计算的,如果某个child你显示的设置了值,就用该childe的显示值,否则就要child的默认值,而且在计算容器的尺寸时,是不考虑children的百分比设置值的,这些值对容器没有,只会用children的默认尺寸或显示的pixel值
参考文档:http://livedocs.adobe.com/flex/3/html/help.html?content=size_position_2.html
About layout in Flex
The Layout Manager controls layout in Flex. The manager uses the following three-stage process to determine the size and position of each component in an application:
Stage 1 - Commitment pass
Determines the property settings of the application's components. This phase allows components whose contents depend on property settings to configure themselves before Flex determines their sizes and positions.
During the commitment pass, the Layout Manager causes each component to run its commitProperties() method, which determines the property values.
Stage 2 - Measurement pass
Calculates the default size of every component in the application. This pass starts from the most deeply nested components and works out toward the Application container. The measurement pass determines the measured, or default, size of each component. The default size of each container is based on the default or explicit (if specified) sizes of its children. For example, the Box container's default width is equal to the sum of the default or explicit widths of all of its children, plus the thickness of the borders, plus the padding, plus the gaps between the children.
During the measurement pass, the Layout Manager causes each component to run its measureSizes() method (a private method that calls the measure() method) to determine the component's default size.
Stage 3 - Layout pass
Lays out your application, including moving and resizing any components. This pass starts from the outermost container and works in toward the innermost component. The layout pass determines the actual size and placement of each component. It also does any programmatic drawing, such as calls to the lineTo() or drawRect() methods.
During the layout pass, Flex determines whether any component's sizing properties specify dimensions that are a percentage of the parent, and uses the setting to determine the child component's actual size. The Layout Manager causes each component to run its updateDisplayList() method to lay out the component's children; for this reason, this pass is also referred to as the update pass.
发表评论
-
Panel高度为0但里面的组件依旧显示
2013-04-24 14:34 1078解决办法: 把Panel中的内容组件用<s:Scroll ... -
约束布局constraint layout
2013-03-01 14:02 1781约束布局constraint layout要点: 1)只有支持 ... -
根据屏幕分辨率动态调整组件大小
2013-02-22 17:34 1507将代码写在组件的preInitialize事件监听器里面 简化 ... -
Flex minWidth minHeight
2013-02-04 16:17 1510minWidth 这个值并不是给组件自己用的,而是给组件的父容 ... -
ActionScript遍历绑定(BindProperty,BindSetter,ChangeWatcher)
2013-02-01 10:11 2438注意: 为防止内存益处,记得调用watcherInstance ... -
Flex程序适应不同屏幕尺寸和分辨率(滚动条)
2013-01-31 15:02 9749FlashBuilder编译后自动生成的xx.html里面定义 ... -
FlexContext, FlexClient,FlexSession
2013-01-15 15:05 2358使用了BlazeDS后,可以从FlexContext中获取一系 ... -
防止RemoteObject批处理AMF消息
2013-01-14 17:01 1249问题描述: 如果你在短时内调用同一个java对象上的两个方法, ... -
自动检测http和https的RemoteObject
2013-01-13 10:30 1723package { import util.Bro ... -
flex浏览器相关辅组类
2012-12-06 13:39 1245package util { import flash. ... -
Flex可变参数带来的问题
2012-12-06 13:34 1477当你在flex的方法中用了可变参数后,你会发现这些参数传到ja ... -
flex如何通过类名称实例化对象
2012-11-30 13:52 2720Getting the class from an objec ... -
flexlib的treeGrid用法
2012-11-30 13:46 1257为了使用treeGrid,通常你需要定义自己的DataDesc ... -
自定义flex tree的DataDescriptor
2012-11-30 13:42 1396public class EnvironmentDataDes ... -
关于Boolean类型在flex与java中间传递的问题
2012-11-30 13:38 1245/** *为简化,只列举两个字段 */ publi ... -
给Flex的Tree赋值方式(XML和ArrayCollection)
2012-11-30 09:33 40131)方式一,mxml内嵌xml数据赋值方式,Embedded ... -
Custom Alert
2012-11-26 19:21 0<?xml version="1.0&qu ... -
Flex服务端分页
2012-11-14 17:00 1043Structure: model event ... -
Flex可携带数据的Aler组件(DataCarriableAlert)
2012-11-14 16:52 1304package component.alert { ... -
映射flex类到java内部类
2012-11-14 16:05 1165java端 public class Person{ p ...
相关推荐
flex4舞台尺寸随浏览器窗口大小改变.rar
通过使用flex来创建基于行和列(可选可调整大小)构建复杂布局的 React 组件。 概述 这个想法很简单。 您将子组件添加到并且每个子组件都将附加到单独的列中。 每个充当容器,在其中自动计算其尺寸并更改 flex 值。 ...
使用Flex组件工具包创建组件 21.2节.在Flash中使用ContainerMovieClip创建Flex容器 21.3节.导入FlashCS3的组件 21.4节.认识Cairngorm小型结构 21.5节.创建Cairngorm视图、事件和模型 21.6节.创建Cairngorm命令和事务...
该库的主要目的是使用最新CSS属性(例如flex box等),而无需考虑支持旧的浏览器,不再使用浏览器前缀,从而使库(具有当前组件集)的大小保持较小。 我希望将其包括所有基本组件和依赖项的最大值保持在15Kb - 20...
支持全高度或内容高度垂直大小调整(基于flex-box) 优化的UX可以清楚地指示打开/关闭的文件夹,所选项目以及对用户输入的React 针对长对象标签进行了优化:标签对于容器而言太大时省略号 针对深层嵌套结构进行了...
加载机制封装组件启动项目毛线发球h5响应式方案个人电脑媒体查询flex,百分比初步布局移动端h5字体大小元素大小,布局元素边距,内填充rem + flex媒体查询+百分比+ flex 自由灵活rem布局方案视口物理上和页面上的...
添加了在组件编辑器,资源管理器和ActiveBOM中为托管组件设置制造商零件选择排名的功能。 22653 将供应商部件号和制造商部件号的检索更改为批处理模式,以防止与BOM报告,SchLib编辑器和带有活动物料清单的OutJob中...
包含的Icon Express编辑程序支持16色、256色以及最大尺寸为127 x 127的真彩图标。 如果愿意同样能整合任意其它的图标编辑应用程序。 展示与原型 在可导航元素(如按键与窗口)之间创建连接以显示控制流程。 为...
根据组件的设备屏幕尺寸查看组件的最佳布局 单击共享图标时,查看社交媒体共享链接 需要挑战方面的支持吗? 并在#help频道中提问。 在哪里找到所有东西 您的任务是将项目扩展到/design文件夹中的/design 。 您会...