Image disappears on setting width [Titanium]

user782400

I created an imageView in Titanium. Whenever I set the width and height of the image to "auto"; the image is not visible. But if I manually set height and width of the image, the image appears.

Why does this happen ?

 var image = Titanium.UI.createImageView({
    backgroundImage:'test.png',
    width: 'auto',
    height: 'auto'
 })
Josiah Hester

If you go here on the DOCs you will see that `auto is deprecated:

'auto' represents the default sizing behavior for a given type of view. The use of 'auto' is deprecated, and should be replaced with the SIZE or FILL constants if it is necessary to set the view's behavior explicitly.

Instead try setting the width and height to Titanium.UI.SIZE, Titanium.UI.FILL, a pixel value, or a percentage of the parent view.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related