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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:08:25+00:00 2026-06-10T20:08:25+00:00

I have an ImageView. I set it in xml as below: <ImageView android:id=@+id/background android:layout_width=wrap_content

  • 0

I have an ImageView.
I set it in xml as below: 

<ImageView
    android:id="@+id/background"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

And set image as below:

ImageView background
background.setImageBitmap(bitmap);

But if the ImageView’s parent layout narrow down, the IamgeView also narrow down.
And the image was resized.
I want to let it don’t resize.
Is it can modify by setScaleType?
Or how to do it?

  • 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-10T20:08:26+00:00Added an answer on June 10, 2026 at 8:08 pm

    Try setting adjustViewBounds parameter to true on the ImageView.

    <ImageView
       android:id="@+id/background"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content" 
       android:adjustViewBounds="true"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this ImageView in my layout: <ImageView android:layout_width=fill_parent android:layout_height=wrap_content android:contentDescription=@string/image_divider android:paddingBottom=8dp android:paddingTop=4dp android:scaleType=fitXY
I have a Imageview in main.xml, how to set the bitmap the to the
I have an ImageView with a source image set in the xml using the
My XML: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=match_parent android:background=#FFFFFF android:orientation=vertical > <ImageView android:id=@+id/imageMenu android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentLeft=true
I have my imageview declared like this: <ImageView android:id=@+id/category_image_top android:layout_width=match_parent android:layout_height=170dp android:maxHeight=170dp android:adjustViewBounds=true android:scaleType=centerCrop
I have a problem with UIButton image if I set its imageView contentMode to
I have an ImageView that has a drawable image resource set to a selector.
<?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical > <ImageView android:id=@+id/venueImage android:layout_width=wrap_content android:layout_height=wrap_content/> </LinearLayout>
I have a xml file in drawable to set border for imageview know as
In my tableview i have set xml data to display but until scroll it

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.