-
30 Apr 2012 1:50 PM #1
Ext.Img component: sizing does not actually size specified image.
Ext.Img component: sizing does not actually size specified image.
It looks like the Img component takes the supplied image and makes it the background-image for an Panel. Since this is the case, scaling of the image cannot be forced. When specifying a width and height, it should apply to the background-size attribute of the Panel.
I was assuming the following options:
which all, of course, would be added to the Panel's background-size attribute.Code:scaling: 'contain' or 'cover' height: 500 width: 500
-
1 May 2012 5:19 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
If you set mode : 'image' on the Ext.Img then it will act the way you wish. Or if you want to leave it as default then you can use this CSS:
Code:.x-img { background-size: 100%; }Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
2 May 2012 9:23 AM #3
Hi Mitchell,
it would be great to see all used properties in the api doc also (not only investigating source code).
That would make live a little bit easier.
Maybe this are hidden gems for experienced developers that like sources but it is good to know that there is always one person who knows them all ;-)
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote