`
superwulei
  • 浏览: 108093 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Flex in Action读书笔记(4. Layout and containers)

阅读更多

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

分享到:
评论

相关推荐

    CoverFlow(com.dougmccune.containers)

    这个效果最初由Doug McCune开发,并以"com.dougmccune.containers"的形式发布,它主要用于Flex和Flash平台,提供了丰富的用户体验。 在Flex和Flash开发中,CoverFlow组件允许开发者创建一个动态、吸引人的用户界面...

    ms-vscode-remote.remote-containers-0.152.0.vsix

    可用的remote-containers插件

    Developing Flex Applications 910p dda_doc88_cracker.zip

    Using ActionScript in Flex applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 CHAPTER 4: Developing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

    Packt.Containers.in.OpenStack.1788394380 ePub

    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 ...

    Microservices and Containers.pdf

    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英文版+源代码

    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 ...

    Introducing Red Hat CodeReady Containers.pdf

    7. Troubleshooting Red Hat CodeReady Containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.1. Basic troubleshooting . . . . . . . . . . . . . . . . . ...

    Microservices and Containers-Addison-Wesley(2018).epub

    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, ...

    Docker-in-Action.pdf

    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 ...

    Microservices and Containers

    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 ...

    kubeadm-master安装依赖镜像.zip

    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 ...

    Professional MFC with VC6

    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 ...

    Packt.Containers.in.OpenStack.1788394380.epub

    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 ...

    Manning Microservices in action

    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 ...

    tencentyun#intlcloud-documents#固定Pod IP类型StatefulSet管理_intl_cn1

    spec.template.spec.containers.0.resources:创建 VPC-CNI 模式的 Pod,您需要添加 requests 和 li

    Prentice.Hall.An.Introduction.to.Design.Patterns.in.C++.with.Qt4.2006.chm

    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, 2nd Edition

    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

    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 ...

Global site tag (gtag.js) - Google Analytics