0

我在 Titanium 中创建了一个 imageView,现在我想使用淡出动画以及更改视图的 backgroundColor 来隐藏它。

我有以下代码

var image = Titanium.UI.createImageView({
    backgroundImage:'test.png',
    width:10,
    height:10,
    top:100,
    left:205
});

image.animate({
    curve:Ti.UI.ANIMATION_CURVE_EASE_IN_OUT, 
    opacity:10, 
    duration:200
});
4

1 回答 1

2

opacity属性是一个从 0.0(完全透明)到 1.0(完全不透明)的浮点值。请尝试使用此代码来淡出图像。

// This code block will fade out the image to invisible
image.animate({
    curve:Ti.UI.ANIMATION_CURVE_EASE_IN_OUT, 
    opacity:0.0, 
    duration:200
});

或者,如果您只想隐藏视图而不使用动画,只需使用hide()和 show() 方法。

于 2013-07-24T21:35:34.897 回答