4. Layout and containers
4.1 Absolute layout
将layout设置为absolute后,原点坐标[0,0]从屏幕左上角开始,向右x增加,向下y增加。
4.2 Constraint-based layout
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundColor="white">
<mx:Canvas width="100%" height="100%">
<mx:constraintColumns>
<mx:ConstraintColumn id="col1" width="100"/>
</mx:constraintColumns>
<mx:constraintRows>
<mx:ConstraintRow id="row1" height="50"/>
<mx:ConstraintRow id="row2" height="50"/>
</mx:constraintRows>
<mx:Button label="Button 1" left="col1:0" right="col1:0"
top="row1:0" bottom="row1:0"/>
<mx:Button label="Button 2" left="col1:10" right="col1:10"
top="row2:0" bottom="row2:0"/>
</mx:Canvas>
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundColor="white">
<mx:Canvas width="100%" height="100%">
<mx:constraintColumns>
<mx:ConstraintColumn id="col1"/>
<mx:ConstraintColumn id="col2"/>
</mx:constraintColumns>
<mx:constraintRows>
<mx:ConstraintRow id="row1" height="50"/>
<mx:ConstraintRow id="row2" height="30"/>
</mx:constraintRows>
<mx:Button label="Button 1" left="col1:0" top="row1:0" width="200" />
<mx:Button label="Button 2" left="col1:0" top="row2:0"/>
<mx:Button label="Button 3" left="col2:0"/>
</mx:Canvas>
</mx:Application>
4.3 Automatic layout
horizontal/vertical
4.4 Variable and fixed sizing
控件的width或者height既可以设置为百分比,也可以设置为固定像素。
4.5 Containers
Container包括
1. Application container
*从custom控件调用Application控件变量myString
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Button label="{mx.core.Application.application.myString}"/>
</mx:Canvas>
2. Canvas container
*使用Canvas时要注意,在一个Canvas中放置多个控件必须指定它们的坐标,否则这些控件可能重叠。
3. Box, HBox, VBox container
HBox:水平放置
VBox:垂直放置
Box:默认放置,同Application.layout
4. Panel container
Panel中可以设置layout
5. ApplicationControlBar, ControlBar container
ApplicationControlBar一般位于Application的顶部;
ControlBar可以位于Panel的底部
6. DividedBox, HDivideBox, VDividedBox containers
7. Form container
Form container包括三个主要标记:Form(主窗体), FormHeader(标题), FormItem(数据输入项)
8. Grid container
类似HTML中的Tabel
9. Tile container
自动排列内部组件的容器,很实用
4.6 Dynamic layout with Repeaters
Repeater控件用于在运行时加载数据。
1. Repeater.dataProvider
ArrayCollection
2. Repeater的Properties和Event
Properties;
id dataProvider startingIndex count currentIndex currentItem recycleChildren
三个常用Event:
repeat repeatStart repeatEnd
分享到:
相关推荐
这个效果最初由Doug McCune开发,并以"com.dougmccune.containers"的形式发布,它主要用于Flex和Flash平台,提供了丰富的用户体验。 在Flex和Flash开发中,CoverFlow组件允许开发者创建一个动态、吸引人的用户界面...
可用的remote-containers插件
Using ActionScript in Flex applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 CHAPTER 4: Developing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
OpenStack gets tremendous traction as it is used by many organizations across the globe and as containers gain in popularity and become complex, it’s necessary for OpenStack to provide various ...
In Microservices and Containers, longtime systems architect and engineering team leader Parminder Kocher analyzes two of the hottest new technology trends: microservices and containers. Together, as ...
ActiveMQ in Action pdf英文原版加源代码压缩包。 Apache ActiveMQ in Action is a thorough, practical guide to implementing message-oriented systems in Java using ActiveMQ. The book lays out the core of ...
7. Troubleshooting Red Hat CodeReady Containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.1. Basic troubleshooting . . . . . . . . . . . . . . . . . ...
Microservices and containers, red-hot topics that, in my opinion, also possess staying power. Compared to the monolithic approach, the most common way of developing and deploying applications, ...
conversations toward Docker and containers. I explained how package management was nice, but enforcing file system isolation as a default solved several management problems. I rattled on about ...
Decide whether microservices and containers are worth your investment, and manage the organizational learning curve associated with them Apply best practices for interprocess communication among ...
registry.aliyuncs.com/google_containers/kube-apiserver:v1.17.0 registry.aliyuncs.com/google_containers/kube-controller-manager:v1.17.0 registry.aliyuncs.com/google_containers/kube-scheduler:v1.17.0 ...
5.Using Dialogs and Controls in MFC 6.User Interface Issues 7.Advanced User Interface Programming 8.Using the Windows Common Controls 9.Writing Programs for the Windows Shell 10.Utility and Exception ...
OpenStack gets tremendous traction as it is used by many organizations across the globe and as containers gain popularity and become more complex, it's necessary for OpenStack to provide various ...
Microservices in Action is a practical book about building and deploying microservice-based applications. Written for developers and architects with a solid grasp of service-oriented development, it ...
spec.template.spec.containers.0.resources:创建 VPC-CNI 模式的 Pod,您需要添加 requests 和 li
An Introduction to Design Patterns in C++ with Qt 4 is a complete tutorial and reference that assumes no previous knowledge of C, C++, objects, or patterns. You'll walk through every core concept, one...
Ext JS in Action, Second Edition starts with a quick overview of the framework and then explores the core components by diving into complete examples, engaging illustrations, and clear explanations....
Cloud Native: Using Containers, Functions, and Data to Build Next-Generation Applications This comprehensive guide helps developers and architects understand current cloud-native technologies, with ...