Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8035051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:12:02+00:00 2026-06-05T02:12:02+00:00

I want to create an animation for an image that is loaded into a

  • 0

I want to create an animation for an image that is loaded into a vertical linear layout dynamically. When triggered I would like the image to slide down with its alpha set to 0 (this will slide all content below it down I hope) then fade the image in. Being new to Android animations I am having some trouble. Right now I’m trying to get just the fade in to work, here is what I have:

fade_in.xml

<?xml version="1.0" encoding="utf-8"?>

<alpha
    xmlns:android="https://chemas.android.com/ap/res/android"
    android:interpolator="@android:anim/anticipate_interpolator"
    android:fromAlpha="0.0"
    android:toAlpha="1.0"
    android:duration="5000" >
</alpha>

In the Activity:

Animation animation = AnimationUtils.loadAnimation(context, R.anim.fade_in);

ImageView image = new ImageView(context);
image.setImageResource(R.drawable.my_image);
image.setLayoutParams(layoutParams);
image.setAlpha(0);

((ViewGroup) view).addView(image, 0);

image.startAnimation(animation);

The image is being loaded as all the context below it is shifted down, however if never fades in. I would like to get this working as well as having the image slide down so the dynamica add does not look so choppy.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:12:03+00:00Added an answer on June 5, 2026 at 2:12 am

    You have a typo in the xmlns:android tag.

    It should be

    xmlns:android = "http://schemas.android.com/apk/res/android"

    With that being corrected, just remove the image.setAlpha(0); and it should animate. I am afraid I cannot give you a reason why it doesn’t work with the alpha attribute set to 0.

    Regarding the slide down animation, you will have to subclass Animation. Have a look at this answer that I think can help you get what you want: https://stackoverflow.com/a/5122460/871102

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a slide-down animation, like in the image in the link.
I want to create an animation using an image that refreshes every 15 minutes
i want create image animation , i have 50 images with png format now
I want to create an animation effects which sort of shakes an image on
I want to create a circle that is sectioned into 4 quarters, and each
I'm using Microsoft VC++ and MFC. Say that I want to create an animation
I'm using jQuery to create animations of an image object. I would like the
I would like to create my own subclass of UIImage that would allow me
I have a problem with switching images in android. I want to create animation
I have a problem with moving animation. I want to create animation which start

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.