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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:04:39+00:00 2026-05-22T20:04:39+00:00

I follow this tutorial to create a GridView : This line: imageView.setLayoutParams(new GridView.LayoutParams(85, 85));

  • 0

I follow this tutorial to create a GridView:

This line:

imageView.setLayoutParams(new GridView.LayoutParams(85, 85));

Size 85×85 is great for my Wildfire, but on HTC Desire it looks very small.
How can I change the image size according to the screen?

I have 2 different layouts, but Gridview hasn’t any attribute in the XML files to change the image size.

  • 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-22T20:04:39+00:00Added an answer on May 22, 2026 at 8:04 pm

    You could try to make an adjustment based off the pixel density of the current device you are on.

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);
    switch(metrics.densityDpi){
         case DisplayMetrics.DENSITY_LOW:
                    imageView.setLayoutParams(new GridView.LayoutParams(lowVal, lowVal));
                    break;
         case DisplayMetrics.DENSITY_MEDIUM:
                    imageView.setLayoutParams(new GridView.LayoutParams(medVal, medVal));
                    break;
         case DisplayMetrics.DENSITY_HIGH:
                     imageView.setLayoutParams(new GridView.LayoutParams(highVal, highVal));
                     break;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to follow this tutorial but instead of generating the expected hbm.xml files
I'm trying to follow the grails tutorial here . When I create a new
I try to create database from entity framework code first follow with this tutorial
I'm trying to follow this little tutorial , but I keep getting this exception.
I'm trying to follow this tutorial, but VS debugger keep asking me for a
Just bought a new Macbook Pro and tried to follow this tutorial step by
I am trying to follow this tutorial on how to connect to a database
I want to include Core Location and I'm trying to follow this tutorial: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/
I follow this rule but some of my colleagues disagree with it and argue
I tried to follow this but the default modelbinder let my array null on

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.