Helpful Information
 
 
Category: Apache Flex
How would I centre a textarea in a canvas

How would I centre a textarea in a canvas that would adjust according to the width of the canvas set in the design view?

<mx:Canvas label="Dynamic and interactive websites with PHP" width="100%" height="100%" >
<mx:HBox width="100%" height="100%" horizontalAlign="center">

<mx:TextArea height="100%" width="90%" />
</mx:HBox>




</mx:Canvas>sorted

<mx:Canvas label="Dynamic and interactive websites with PHP" width="100%" height="100%" >
<mx:HBox width="100%" height="100%" horizontalAlign="center">

<mx:TextArea height="100%" width="90%" />
</mx:HBox>




</mx:Canvas>sorted
Well, if you wanted to do it in the Source view, you could use the code style you provide. To do it a bit more easily in Design view, just click on the appropriate checkboxes in the Properties panel under Standard View > Layout > Constraints. The code is generated for you.

Hi friend, I am using photoshop CS2 and I have made painting on canvas size of 260x120. And I have some text to put on it. How do I center my text? I started with a canvas and added an oil paint background. I thought it would be so simple but I could not. I need your tips. Can you help me? Any helpful tips would be greatly appreciated. Thank you.

if ur canvas have some parent component then there u can provide horizontalAlign="center"
like


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" pageTitle="Login"
xmlns="*" width="100%" height="100%" horizontalAlign="center" >

<mx:Canvas label="Dynamic and interactive websites with PHP" width="100%" height="100%" >
<mx:HBox width="100%" height="100%" horizontalAlign="center">

<mx:TextArea height="100%" width="90%" />
</mx:HBox>

</mx:Canvas>

</mx:Application>




or one more thing u can do, u can provide padding (either left or right).

Write
HorizontalCenter=verticalCenter=0;










privacy (GDPR)