Hi guys
I'm having issues right aligning images.
Let's say the original image dimensions are 100x50 pixels. If I explicitly set the height of the image to 25 pixels it correctly resizes to 50x25 pixels. However, it seems like a container of 100x50 pixels is still present and that the resized image is centered within it.
var $image = Ti.UI.createImageView({ image: '/img/test.png', height: 25, backgroundColor: '#ff0000', right: 0 });So instead of right aligning it just stays at the center of the original image dimensions.
Anything I can do to prevent this behavior? I'm using the latest SDK.
5 Answers
Have you tried setting width: Ti.UI.SIZE? That might help...
I have not had this problem. If I take a 200x150 image and put it into a 100x75 ImageView, the ImageView is 100x75, and the image itself is resized to 100x75 so that it fits with no excess border.
Are you actually seeing a 100x50 area with background color #ff0000?
We might need to see a little more of your code. I stress little. If you can make a minimal example (a single app.js file), that would be great. And maybe a screenshot of the problem.
ImageView's property - right - This is relative to the view's parent.So try placing imageview in a parent view and specify its right relative to the parent view.
Hi John Are you specifying any layout for parent view?
I did not faced this issue, but if you are facing then use work around to solve your problem, put that imageview inside a view which is at right=0 and according to your dimension. i will look for this sure and let you know and correct way.
Your Answer
Think you can help? Login to answer this question!