Resizing components for wide screen in Flex
I am using % values for height and width propertie开发者_开发问答s of my components, so they would look some what similar in different screen resolutions. But when the aspect ratio changes or on Wide Screen monitors, my components are looking very badly as in not consistent and somewhat stretched. Can any one provide any good solutions for this problem?
"systemManager.stage.scaleMode=StageScaleMode.SHOW_ALL" This command used to resize. Use it in Application Initialize.
Silverback,
For the stretching it's likely you're using embedded images for skinning and not nine-slicing them (or not nine-slicing them correctly one of the two). When you nine-slice you just specify a cut off point for the parts that will be allowed to stretch vs those that cannot... more on this here:
http://livedocs.adobe.com/flex/3/html/help.html?content=embed_4.html
http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_4.html
For Spark: http://www.unitedmindset.com/jonbcampos/2010/05/27/9-slice-scaling-with-spark-skinning/
Alternatively if your graphics could be recreated by using programmatic drawing instead of using image files and nine-slicing this is sometimes a good alternative. Furthermore I'd suggest setting some sort of maxWidth and minWidth values on the objects if you're going for sizing based on percentage so you can make sure if monitors get out of control with resolution you won't have a huge super funky looking button.
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f8e.html
If you're using Flex 4 I believe the skinning should be approached by creating an extension of one of the newer Spark skin classes.
http://help.adobe.com/en_US/flex/using/WS53116913-F952-4b21-831F-9DE85B647C8A.html
Shaun
精彩评论