Animation class for controlling the transparency, which inherits from Animation.
Model restriction: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since version 4.1.0(11).
System capability: SystemCapability.Map.Core
Since: 4.1.0(11)
constructor(fromAlpha: number, toAlpha: number)
Constructor, which is used to construct an animation instance for transparency control.
Model restriction: This API can be used only in the stage model.
Atomic service API: This API can be used in atomic services since version 4.1.0(11).
System capability: SystemCapability.Map.Core
Since: 4.1.0(11)
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| fromAlpha | number | Yes | Initial transparency. The value ranges from 0 (completely transparent) to 1 (opaque). Invalid values are not processed. |
| toAlpha | number | Yes | Target transparency. The value ranges from 0 (completely transparent) to 1 (opaque). Invalid values are not processed. |
Example:
let animation: map.AlphaAnimation = new map.AlphaAnimation(0.2, 1);