You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2017/11/13 07:30:15 UTC

[GitHub] Harbs commented on issue #79: Centre image incorrectly positions image and fails to take account of it's height and width

Harbs commented on issue #79: Centre image incorrectly positions image and fails to take account of it's height and width
URL: https://github.com/apache/royale-asjs/issues/79#issuecomment-343835608
 
 
   You did not specify a size for the image. The following works:
   
   ````
   <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic">
       
       <js:valuesImpl>
           <js:SimpleCSSValuesImpl/>
       </js:valuesImpl>
   
       <js:initialView>
           <js:View width="100%" height="100%">
               <js:Container width="600" height="300">
                   <js:style>
                       <js:SimpleCSSStyles backgroundColor="#FF0000" />
                   </js:style>
                   <js:Image src="http://apache.org/img/asf_logo.png" width="429" height="175">
                       <js:beads>
                           <js:CenterElement />
                       </js:beads>
                   </js:Image>
               </js:Container>
           </js:View>
       </js:initialView>
   </js:Application>
   ````
   If you need the image to be centered after it's loaded and the size calculated, you will need to trigger a new layout event once that happens.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services