Aracılığıyla paylaş


Animator.SetTarget(Object) Method

Definition

Sets the target object whose property will be animated by this animation.

[Android.Runtime.Register("setTarget", "(Ljava/lang/Object;)V", "GetSetTarget_Ljava_lang_Object_Handler")]
public virtual void SetTarget (Java.Lang.Object? target);
[<Android.Runtime.Register("setTarget", "(Ljava/lang/Object;)V", "GetSetTarget_Ljava_lang_Object_Handler")>]
abstract member SetTarget : Java.Lang.Object -> unit
override this.SetTarget : Java.Lang.Object -> unit

Parameters

target
Object

The object being animated

Attributes

Remarks

Sets the target object whose property will be animated by this animation. Not all subclasses operate on target objects (for example, ValueAnimator, but this method is on the superclass for the convenience of dealing generically with those subclasses that do handle targets.

<strong>Note:</strong> The target is stored as a weak reference internally to avoid leaking resources by having animators directly reference old targets. Therefore, you should ensure that animator targets always have a hard reference elsewhere.

Java documentation for android.animation.Animator.setTarget(java.lang.Object).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to