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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:43:17+00:00 2026-06-11T00:43:17+00:00

When I run my app on screen 4.3 it works fine but when I

  • 0

When I run my app on screen 4.3 it works fine but when I run on 3.14 screen, images don’t show correctly one above the other in a big size.

Is there a way to show an image using percentage which depends on different screen sizes?

Here is the ImageView code:

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ImageView imageView = new ImageView(mContext);
    imageView.setImageResource(mThumbIds[position]);
    imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
    imageView.setLayoutParams(new GridView.LayoutParams(200,200 ));
    return imageView;
}
  • 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-11T00:43:18+00:00Added an answer on June 11, 2026 at 12:43 am

    i found the solution of my answer
    it’s close to @dmon answer

    I created dimensions.xml in Values folder

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    <dimen name="width">150dp</dimen>   
    <dimen name="height">150dp</dimen>
    </resources>
    

    and in imageadapter.java

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView = new ImageView(mContext);
        imageView.setImageResource(mThumbIds[position]);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setLayoutParams(new GridView.LayoutParams(
                (int) mContext.getResources().getDimension(R.dimen.width),                                                                                   
                (int) mContext.getResources().getDimension(R.dimen.height)));
        imageView.setPadding(5, 5, 5, 5);
        return imageView;
    }
    

    thanks for everyone tried to help
    best regards

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

Sidebar

Related Questions

What's incorrect in this manifest to run an app as Admin? It works fine
App works fine in android 3.2 but not in android 3.1 My application is
if I run my app under iOS5 all seems to be fine. But if
I can't execute an app i have developed for iOs 5. It works fine
I have a 9-patch file that works fine in Android v2.2 but when I
I've made a trial app using ST2, it works just fine while using only
I developed an app that plays a video on fullscreen mode, it works fine
I have been developing an app which should support multiple screen sizes. It works
I'm building an iPhone app, and it works fine when I test it in
when i run app in the IPhone simulater 5.1 the default image loads up

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.