<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    gembin

    OSGi, Eclipse Equinox, ECF, Virgo, Gemini, Apache Felix, Karaf, Aires, Camel, Eclipse RCP

    HBase, Hadoop, ZooKeeper, Cassandra

    Flex4, AS3, Swiz framework, GraniteDS, BlazeDS etc.

    There is nothing that software can't fix. Unfortunately, there is also nothing that software can't completely fuck up. That gap is called talent.

    About Me

     

    How to use verticalCenter and horizontalCenter in a container with absolute layout


    In this tutorial I will explain how you can use the verticalCenter and horizontalCenterconstraints in a container with absolute layout.

    At this stage you probably already figured out how to use the leftrighttopbottomconstraints. But what about horizontalCenter and verticalCenter?

    horizontalCenter is the distance from the center of the container in the horizontal where you want your component to appear. If you give it a positive value, the component will show up in the right half of the container. If you give it a negative value the component will appear in the left half.

    <mx:Canvas width="500" height="500">
    <mx:Button horizontalCenter="200" label="Right half of the container"/>
    <mx:Button horizontalCenter="-200" label="Left half of the container"/>
    </mx:Canvas>
    

    If you try to combine horizontalCenter with left or right constraints, they will always be ignored as the horizontalCenter constraint always takes precedence.

    <mx:Canvas width="500" height="500">
    <mx:Button horizontalCenter="200" left="400" label="Button 1"/>
    <mx:Button horizontalCenter="200" right="200" label="Button 2"/>
    </mx:Canvas>
    

    In the example above the two buttons will overlap because the value of the left andright coordinate is ignored.

    verticalCenter is the distance from the center of the container in the vertical where you want your component to appear. If you give it a positive value, the component will show up in the bottom half of the container. If you give it a negative value the component will appear in the top half.

    <mx:Canvas width="500" height="500">
    <mx:Button verticalCenter="200" label="Bottom half of the container"/>
    <mx:Button verticalCenter="-200" label="Top half of the container"/>
    </mx:Canvas>
    

    If you try to combine verticalCenter with top or bottom constraints, they will always be ignored as the verticalCenter constraint always takes precedence.

    <mx:Canvas width="500" height="500">
    <mx:Button verticalCenter="200" top="400" label="Button 1"/>
    <mx:Button verticalCenter="200" bottom="200" label="Button 2"/>
    </mx:Canvas>
    

    In the example above the two buttons will overlap because the value of the top andbottom constraint is ignored.

    The code below shows possible combinations of horizontalCenter and verticalCenterthat you can use to layout your components:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="520" width="520">
    <mx:Button label="Left Center" horizontalCenter="-200" verticalCenter="0">
    </mx:Button>
    <mx:Button label="Center" horizontalCenter="0" verticalCenter="0">
    </mx:Button>
    <mx:Button label="Right Center" horizontalCenter="200" verticalCenter="0">
    </mx:Button>
    <mx:Button label="Top Left" horizontalCenter="-200" verticalCenter="-200">
    </mx:Button>
    <mx:Button label="Top Center" horizontalCenter="0" verticalCenter="-200">
    </mx:Button>
    <mx:Button label="Top Right" horizontalCenter="200" verticalCenter="-200">
    </mx:Button>
    <mx:Button label="Bottom Left" horizontalCenter="-200" verticalCenter="200">
    </mx:Button>
    <mx:Button label="Bottom Center" horizontalCenter="0" verticalCenter="200">
    </mx:Button>
    <mx:Button label="Bottom Right" horizontalCenter="200" verticalCenter="200">
    </mx:Button>
    <mx:Button label="Ignored right constraint" right="10" horizontalCenter="-200" verticalCenter="50">
    </mx:Button>
    <mx:Button label="Not ignored right constraint" right="10" verticalCenter="50">
    </mx:Button>
    <mx:Button label="Ignored top constraint" top="10" horizontalCenter="-200" verticalCenter="-50">
    </mx:Button>
    <mx:Button label="Not Ignored top constraint" top="10" horizontalCenter="-200">
    </mx:Button>
    </mx:Application>

    posted on 2010-08-17 23:10 gembin 閱讀(591) 評論(0)  編輯  收藏 所屬分類: Flex4


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導航:
     

    導航

    統(tǒng)計

    常用鏈接

    留言簿(6)

    隨筆分類(440)

    隨筆檔案(378)

    文章檔案(6)

    新聞檔案(1)

    相冊

    收藏夾(9)

    Adobe

    Android

    AS3

    Blog-Links

    Build

    Design Pattern

    Eclipse

    Favorite Links

    Flickr

    Game Dev

    HBase

    Identity Management

    IT resources

    JEE

    Language

    OpenID

    OSGi

    SOA

    Version Control

    最新隨筆

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    free counters
    主站蜘蛛池模板: 亚洲自偷自偷在线制服 | 四虎成人免费大片在线| 亚洲第一成年网站视频| AV在线播放日韩亚洲欧| 99久久久国产精品免费牛牛四川| 一本色道久久88—综合亚洲精品 | 毛片在线全部免费观看| 亚洲色欲啪啪久久WWW综合网| 亚洲人妻av伦理| 免费人成网站在线观看10分钟| 极品美女一级毛片免费| 在线观看亚洲一区二区| 国产午夜鲁丝片AV无码免费| 久久九九AV免费精品| 色欲色欲天天天www亚洲伊| 亚洲国产美国国产综合一区二区 | 在线观看成人免费视频| 中国内地毛片免费高清| 亚洲欧美成aⅴ人在线观看| 亚洲AV无码精品无码麻豆| 日韩成人免费aa在线看| 99久久免费中文字幕精品| 九九视频高清视频免费观看 | 日本一道本不卡免费| 青青免费在线视频| 亚洲国产成人资源在线软件| 国产亚洲自拍一区| 国产黄色片在线免费观看| 亚洲黄色免费在线观看| 三级黄色在线免费观看| 老妇激情毛片免费| 亚洲免费综合色在线视频| 亚洲成a人片在线观| 亚洲AV午夜成人片| 亚洲综合在线另类色区奇米 | 国产精品亚洲综合五月天| 亚洲av无码乱码国产精品| 精品国产亚洲一区二区在线观看| 欧洲精品免费一区二区三区| 国产无人区码卡二卡三卡免费| 日本免费人成网ww555在线|