- 浏览: 807019 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (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 1122解决办法: 把Panel中的内容组件用<s:Scroll ... -
约束布局constraint layout
2013-03-01 14:02 1868约束布局constraint layout要点: 1)只有支持 ... -
根据屏幕分辨率动态调整组件大小
2013-02-22 17:34 1560将代码写在组件的preInitialize事件监听器里面 简化 ... -
Flex minWidth minHeight
2013-02-04 16:17 1568minWidth 这个值并不是给组件自己用的,而是给组件的父容 ... -
ActionScript遍历绑定(BindProperty,BindSetter,ChangeWatcher)
2013-02-01 10:11 2508注意: 为防止内存益处,记得调用watcherInstance ... -
Flex程序适应不同屏幕尺寸和分辨率(滚动条)
2013-01-31 15:02 9887FlashBuilder编译后自动生成的xx.html里面定义 ... -
FlexContext, FlexClient,FlexSession
2013-01-15 15:05 2429使用了BlazeDS后,可以从FlexContext中获取一系 ... -
防止RemoteObject批处理AMF消息
2013-01-14 17:01 1341问题描述: 如果你在短时内调用同一个java对象上的两个方法, ... -
自动检测http和https的RemoteObject
2013-01-13 10:30 1841package { import util.Bro ... -
flex浏览器相关辅组类
2012-12-06 13:39 1290package util { import flash. ... -
Flex可变参数带来的问题
2012-12-06 13:34 1532当你在flex的方法中用了可变参数后,你会发现这些参数传到ja ... -
flex如何通过类名称实例化对象
2012-11-30 13:52 2777Getting the class from an objec ... -
flexlib的treeGrid用法
2012-11-30 13:46 1331为了使用treeGrid,通常你需要定义自己的DataDesc ... -
自定义flex tree的DataDescriptor
2012-11-30 13:42 1449public class EnvironmentDataDes ... -
关于Boolean类型在flex与java中间传递的问题
2012-11-30 13:38 1291/** *为简化,只列举两个字段 */ publi ... -
给Flex的Tree赋值方式(XML和ArrayCollection)
2012-11-30 09:33 40651)方式一,mxml内嵌xml数据赋值方式,Embedded ... -
Custom Alert
2012-11-26 19:21 0<?xml version="1.0&qu ... -
Flex服务端分页
2012-11-14 17:00 1094Structure: model event ... -
Flex可携带数据的Aler组件(DataCarriableAlert)
2012-11-14 16:52 1372package component.alert { ... -
映射flex类到java内部类
2012-11-14 16:05 1218java端 public class Person{ p ...
相关推荐
这是最基本的属性,用来设置或获取Flex组件的宽度。它可以直接赋值为一个具体的像素值、百分比或者其他单位。 #### 2. *maxWidth 和 *minWidth 这两个属性分别限制了Flex组件的最大和最小宽度。当组件的宽度受到...
通过Flexbox,我们可以轻松地调整元素的大小、顺序和对齐方式,以适应不同的屏幕尺寸和方向。 2. **下拉框组件** 下拉框(Dropdown)是用户界面中常见的一种控件,用于显示一个可选列表。在Flex下拉框组件中,用户...
它允许开发者在不同尺寸的设备上灵活地调整元素的大小和位置,尤其适用于响应式网页设计。在Web开发中,随着移动优先的设计理念普及,Flex布局已经成为现代网页布局的标准之一。 博文链接虽然没有提供具体内容,但...
在本文中,我们将深入探讨“Flex组件时间轴”,这是一种在现代Web开发中广泛使用的界面元素。Flex组件时间轴主要用于组织和展示按照时间顺序排列的数据,它在各种项目中都有着重要的应用,尤其对于需要呈现时间序列...
Flex组件是一种广泛应用于Web开发中的布局工具,尤其在创建响应式设计时,它能帮助开发者构建灵活、可自适应不同屏幕尺寸的用户界面。在Web前端开发领域,Flex布局(也称为Flexbox)已经成为现代CSS布局的标准,它...
Flex组件的边框线样式也需要根据不同的屏幕尺寸进行适配。可以使用Flex的布局管理器和媒体查询来实现不同分辨率下的样式切换。 7. 模式对话框(Modal Dialogs) 模式对话框通常需要有特殊的边框样式以突出其重要性...
Flex组件的生命周期是Adobe Flex框架中一个至关重要的概念,它涉及到UIComponent类及其子类(如Button、Canvas等)在创建、初始化、显示和销毁过程中的各个阶段。深入理解组件生命周期有助于开发者更有效地管理组件...
#### 一、为何需要重写Flex组件? 在Flex开发过程中,经常遇到已有的组件无法完全满足项目需求的情况。这些需求可能包括但不限于改变组件的外观、增加新的功能特性或者实现更复杂的交互逻辑。在这种背景下,重写...
解决这个问题的关键在于调整Z-index,即设置IFrame和Flex组件的层级关系。在Flex中,可以为每个组件设置`includeInLayout`属性和`zIndex`属性来控制它们在堆叠顺序中的位置。确保菜单组件的`zIndex`值高于IFrame,使...
组件生命周期是每个Flex组件从创建到销毁所经历的一系列阶段。理解组件生命周期至关重要,因为它涉及到组件何时初始化、何时准备显示、何时接收用户输入以及何时被销毁。以下是一些关键的生命周期方法: 1. **...
1. **放大与缩小**:Flex组件可以通过JavaScript或CSS来实现大小调整。使用CSS,我们可以通过`resize`属性来允许用户手动调整元素大小,如`resizable: both;`。若需动态改变大小,可以结合JavaScript监听窗口大小...
在给定的标题“支持手动拖拽缩放flex组件的组件”中,我们可以推断出这是一个专门针对Flex环境设计的组件,它允许用户通过手动拖拽和缩放操作来调整Flex应用中的组件大小。 描述中提到的“com.janisRadins.zip”很...
flex4舞台尺寸随浏览器窗口大小改变.rar
而`updateDisplayList()`方法则用于在测量阶段之后,根据组件的尺寸和位置属性来定位和绘制子组件,包括它们的大小和位置。 布局方面的定制,主要涉及`measure()`和`layoutChrome()`方法。`measure()`负责计算组件...
它特别适合用于现代网页和移动应用的设计,因为它可以自动调整元素的大小和位置以适应不同的屏幕尺寸。 首先,让我们理解Flex容器(ContainerCtrl)的概念。在Flex布局中,容器是包含一个或多个子元素的元素,这些...
在实际应用中,了解并熟练掌握这些Flex组件的CSS样式属性至关重要,这能帮助我们构建出高效、适应性强的前端界面。通过实践和不断试验,开发者能够更好地理解和运用这些属性,提升布局设计的灵活性和效率。
### 深入理解FLEX组件生命周期 #### 一、引言 在FLEX开发过程中,深入了解组件的生命周期对于优化应用程序性能、确保组件正确响应用户交互至关重要。本文将详细解析Flex组件生命周期的主要阶段:初始化...
这通常发生在原生Flex组件无法满足我们的外观、行为或功能要求时。本文将探讨Flex组件重写的必要性、考虑因素、以及AS和MXML方式的选用规则,并提供AS方式重写组件的一般步骤。 一、为什么要重写组件 1. 扩展功能:...