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 6565845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:08:44+00:00 2026-05-25T14:08:44+00:00

Everything looks perfect when I use the ImageView to show a png image like

  • 0

Everything looks perfect when I use the ImageView to show a png image like this:

<ImageView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/png_picture"
     android:src="@drawable/paos_connection"/>

The image is scaled perfectly, fills the screen horizontally and has the correct aspect ratio.

Now, I want to replace the image with an animation. I decided on using Frame Animation as shown here: http://developer.android.com/guide/topics/graphics/view-animation.html. I am using the same size png files (slightly modified copies of the original one).

My problem is that the animation is playing and it is filling up the screen horizontally as before, but it is now stretched vertically. I can force it to have the correct height by hard-coding a height:

<ImageView 
     android:layout_width="fill_parent" 
     android:layout_height="210px" 
     android:id="@+id/animation" />

…but obviously this is not a good solution because the image should have the correct aspect ratio on all screen sizes.

  • 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-05-25T14:08:45+00:00Added an answer on May 25, 2026 at 2:08 pm

    This may help. I’ve found without a lot of footwork, you’re stuck using a fixed element unless the image is drawn in order with the rest of the layout on initialization.

    http://developer.android.com/reference/android/widget/ImageView.ScaleType.html

    A quick hack to try would be to set a transparent image in its place with the same dimensions as the animated image. Programatically create an ImageView using the width & height of the rendered transparent image. Following that, animate the the instantiated image.

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

Sidebar

Related Questions

I have some images, named SomeImage.png and SomeImage-hd.png( for retina). Everything looks with non-
I have applied CSS style to JavaFX components and it looks like everything is
My panel with border layout looks like this: var oSplitPanel = Ext.create('Ext.panel.Panel', { lid
I'm working with a website and everything looks good except the one issue with
When I upload any file everything looks good. I have those pictures in pics
I have recently installed clang_complete plugin for VIM. Everything looks fine except in popup
I want to setup jetty with jetty-blazeds extension. Everything looks fine but when I
I have made a list with few elements in it. Now everything looks right,
I wrote some code for the ising model in python (2d). Everything looks seems
I've installed WAMPServer (latest). Python 2.6 and Django 1.4 . Everything looks to be

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.