Viewanimator of Android Docs

Source: Internet
Author: User

First, the structure

public class Viewanimator extends Framelayout
Java.lang.Object
Android.view.View
Android.view.ViewGroup
Android.widget.FrameLayout
Android.widget.ViewAnimator

Ii. Overview
Framelayout the base class of the container, which displays an animated effect when the view is toggled.
(This class is not commonly used, its direct subclass Viewflipper, viewswitcher or indirect subclass Imageswitcher, Textswitcher)

Third, XML properties
Property name
Description Android:inanimation (animation used when setting the view into screen)
Android:outanimation (sets the animation used when the view leaves the screen)

Iv. Public methods
public void AddView (View child, int index, viewgroup.layoutparams params)

Adds a child view with the specified layout parameters.
Parameters
Child added children view
Where the child view added by index is located
Params setting layout parameters for a child view
public int Getbaseline ()
Returns the offset of the widget's text baseline to the bounds of the widget, which returns 1 if the current widget does not support baseline alignment.

return value
The offset of the Beinecke line in the widget bounds, if the baseline alignment is not supported, returns-1
Public View Getcurrentview ()
Returns the view corresponding to the currently displayed child element
return value
The currently displayed view
See
Getdisplayedchild ()
public int Getdisplayedchild ()
Returns the index of the currently displayed child view
Public Animation getinanimation ()
Returns the animation that is used to display the view into the screen
return value
An animated object animation, if not set, returns a null
See
Setinanimation (android.view.animation.Animation)
Setinanimation (Android.content.Context, int.)
Public Animation getoutanimation ()
Returns the animation that is used to display the view leaving the screen
return value
An animated object animation, if not set, returns a null
See
Setoutanimation (android.view.animation.Animation)
Setoutanimation (Android.content.Context, int.)
public void Removeallviews ()
Call this method to remove all child views from the ViewGroup
public void Removeviewat (int index)
Remove a view at a specified location in a group
Parameters
Index the position of the view in the group that needs to be removed
public void Removeviewinlayout (view view)
Removes a view at layout time. This method is useful when you need to remove a view in OnLayout ().
Parameters
View to remove from a group
public void removeviews (int start, int count)
Remove a specified range of views from a group
Parameters
Start position of multiple views to remove in the group
Count removes the number of views
public void Removeviewsinlayout (int start, int count)
Removes a set of views at layout time. This method is useful when you need to remove many views in onlayout ().
Parameters
Start the index of the first view in the group with multiple views removed
Count removes the number of views
public void Setanimatefirstview (Boolean animate)
Sets whether the current view is animated when it is first loaded.
Parameters
Whether animate displays the current view the first time it is displayed
public void Setdisplayedchild (int whichchild)
Set which child view will be displayed
Parameters
Whichchild the index of the child view that will be displayed
public void Setinanimation (Animation inanimation)
Sets the animation that the view uses when it enters the screen.
Parameters
Inanimation the animation used when the view enters the screen
See
Getinanimation ()
Setinanimation (Android.content.Context, int.)
public void Setinanimation (context context, int ResourceID)
Sets the animation that the view uses when it enters the screen.
Parameters
Context contexts
ResourceID The resource ID of the animation
See
Getinanimation ()
Setinanimation (android.view.animation.Animation)
public void Setoutanimation (Animation outanimation)
Animate when setting the view to exit the screen
Parameters
Outanimation animation that starts when the view exits the screen

Viewanimator of Android Docs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.