Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to expand the image size with keeping ratio.

$
0
0

How to expand the image size with keeping ratio.

I would like to keep the image ratio when expanding. I would like to set height 10% of vertical screen size and adjust width according to the percents of expanding.

for example

screen size is 480 * 600
original image is 20 * 40
image height is set 48 so I would like to set width 96.

How can I make it ?

"#Button":{
       image:"/img/text.jpg",
    left:0,
    height:'10%',width:'auto'
    backgroundColor:"red"
},
it dosen't expand image correctly.

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>