Hi,
How can I center a loaded photo [lets say 200x300] in an image control [lets say 400x600]? My image control has fixed dimensions while my contents have different dimensions and I want them to get centered automatically.
Thanks in advance
Hi,
How can I center a loaded photo [lets say 200x300] in an image control [lets say 400x600]? My image control has fixed dimensions while my contents have different dimensions and I want them to get centered automatically.
Thanks in advance
You should probably take a different approach here. I would place your image component in a container, say mx.containers.VBox
Give your Image component a fluid width, and center it within your container:
vBox.setStyle('horizontalAlign', 'center');
vBox.setStyle('verticalAlign', 'middle');