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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:50:56+00:00 2026-05-30T11:50:56+00:00

I have a problem with my listview which contains an ImageView and a few

  • 0

I have a problem with my listview which contains an ImageView and a few TextView for each item.

More or less, there are two lines of TextViews and one ImageView (XX) that should take the two lines :

|XX| TextView 1     TextView 2
|XX| TextView 3     TextView 4

My problem is when I change the image in the ImageView. My goal is to have the same height for the imageview as for the two textviews together. But my image being 400×300, the imageview is expanded to contain it. I tried to get the height of the imageView with getHeight or getMeasuredHeight to resize the bitmap before putting it in the imageView, it does not work.

My layout for the listview is:

<RelativeLayout 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/list_poi_image"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:scaleType="centerCrop"
    android:contentDescription="@string/points_of_interest_activity_image_content_description" />

<TextView
    style="@style/CarloText"
    android:id="@+id/list_poi_name"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_toRightOf="@+id/list_poi_image"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
    style="@style/CarloText"
    android:id="@+id/list_poi_description"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/list_poi_name"
    android:layout_below="@+id/list_poi_name"
    android:textAppearance="?android:attr/textAppearanceMedium" />

…

Thanks for you help !!!

  • 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-30T11:50:57+00:00Added an answer on May 30, 2026 at 11:50 am

    Set some fixed height to imageview, and set scale type of imageView FIT_XY or CENTER_INSIDE. FIT_XY will scale your image to desired width and height, irrespective of aspect ration, so image may stretch, CENTER_INSIDE will scale your image in given dimensions maintaining aspect ratio of image, so image may look samaller than available space.

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

Sidebar

Related Questions

I have a ListView with few elements, each item contains two buttons with a
I have a ListView in which each item has a complex layout that contains,
I have a ListView which contains an ImageView and a TextView. I'm subclassing ArrayAdapter
I have a problem with listview which list item contain a checkbox. When i
I have made a custom listView which which extends ListActivity and each row contains
Here's the problem. In my app, I have 5 tabs which contains activities. In
I have a listview that contains values from webservice.Each page contains only 10 listitems
I have listView in which I inflate a row contain textview and button now
I have a following problem. I have a ListView which returns data from SQL
I'm having a problem with a user control I'm developing which contains a ListView

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.