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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:01:28+00:00 2026-05-30T03:01:28+00:00

I load an image into an ImageView using .setImageURI(selectedImageUri) that is retrieved from the

  • 0

I load an image into an ImageView using .setImageURI(selectedImageUri) that is retrieved from the user’s photo gallery. I have the image view restrict the size with

android:maxHeight="150dp"
android:minHeight="150dp" 
android:maxWidth="150dp" 
android:minWidth="150dp"

It’s fine up until the you add the image from the gallery. The image then forgets about the max height and width. It is as wide as the display and there is a lot of space above and below the image. I had to add a scrollview just to see the image and scroll down. there is an even amount of space above and below. Has anyone run into this problem before?

  • 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-30T03:01:29+00:00Added an answer on May 30, 2026 at 3:01 am

    Add the following to your XML code (Or use the appropriate function)

    android:adjustViewBounds="true"
    

    I don’t know why this isn’t a default, because it seems like it would be required for a large number of items. Still, adding this simple logic to your XML file will make all of the difference.

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

Sidebar

Related Questions

I have activity that load's image from server into imageview. Image is displayed after
We have a requirement that a user can load any standard image into a
I have an image that I get and attempt to load into a graphics
how can we html.fromhtml to load image from web and set into imageview ?
I would like to load images into a gallery view from a url? I
Ive i have two images from a URL into my gallery view. But when
How to load into ImageView if I have string which contains image position on
I use the following code to load an image into an scroll view. The
I'm trying to load an image into an UIImageView from the internet. This is
Objective-C / Cocoa: I need to load the image from a JPG file into

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.