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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:04:21+00:00 2026-06-06T02:04:21+00:00

I have a ListView and each row has an ImageView. These Images are downloaded

  • 0
  • I have a ListView and each row has an ImageView.

  • These Images are downloaded in a separate thread and then appended to the ImageViews in the UI thread.

  • The images I am downloading are 92 X 136 px. I am scaling these images down to 50 X 100 px each using the BitmapFactory.

  • I want these images to look the same size across different screensizes.I understand that on a screen with higher density these images can look smaller and on those with lower density they can look bigger.

  • Normally we would put such images in mdpi,hdpi etc folders , but in this case the images are beig downloaded dynamically and scaled programatically.

    Can someone point me in the right direction as to what I should do. I dont need any codes.. just some algo should do…

  • 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-06T02:04:22+00:00Added an answer on June 6, 2026 at 2:04 am

    One way is to scale in DP like this:

    int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, <HEIGHT>, getResources().getDisplayMetrics());
    

    The other way is to hardcode the dimensions on the imageView in dp or assign its height width programaticaly after getting the screen metrics and calculating some percentage of the width/height to fill(although i think using just the fixed dp in the layout will be sufficient, if needed you can use values/dimensions to mark the size of the view). And assign a scaleType like fitXY or centerCrop to the imageView to fill the whole content area.

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

Sidebar

Related Questions

I have a listView, where each row has a button in the row layout.
I have a ListView, each row have an ImageView to load a small icon.
I have a ListView that each row has a title on the left side
I have android application with ListView, where each row has own refresh button. Refreshing
I have a ListView where each row has two webviews side by side, taking
I have a ListView that uses SimpleAdapter, each row has 2 TextViews, and I
I have a ListView where each row has a fixed height. Every row contains,
I have a ListView that creates a table. Each row in the table has
I have a ListView whose rows are formatted by me. Each row has a
I have a ListView with some elements on it. Each row has a TextView

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.