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');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.