开发者

How to centre an image horizontaly and vertically in an Image Control?

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 cent开发者_如何学Cered 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');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜