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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:18:34+00:00 2026-05-31T03:18:34+00:00

I have a listview with custom rows. In imageView1 I set an image, but

  • 0

I have a listview with custom rows. In imageView1 I set an image, but it is smaller than the height of the row . The image size is 4x30px. When I set a 40×300 img size (programmatically), the row gets too big (I know the reason: wrap_content). How can I set that the image be streched in height to the height of the row?

holder.image.setImageDrawable(convertView.getResources().getDrawable(R.drawable.priority_4x30));

xml.file:

   <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="horizontal"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
    >
      <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/icon"
        android:focusable="false" />

      <TextView android:id="@+id/textView1" 
        android:layout_width="180dip" 
        android:layout_height="wrap_content"
        android:paddingTop="15dip"
        android:paddingBottom="15dip"
        android:textColor="#000000"
        android:layout_toRightOf="@+id/imageView1">
      </TextView>

      <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/icon"
        android:layout_toRightOf="@+id/textView1" />

      <CheckBox android:id="@+id/checkBox1" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginRight="6sp"
        android:focusable="false"
        android:layout_toRightOf="@+id/imageView2">
      </CheckBox>

    </RelativeLayout>
  • 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-31T03:18:36+00:00Added an answer on May 31, 2026 at 3:18 am

    You should make your relativelayout for each item have a static height

    ex:

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="?android:attr/listPreferredItemHeight">
    

    and then you can simply change your imageview to fill parent for its height

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:src="@drawable/icon"
        android:layout_toRightOf="@+id/textView1" />
    
    • 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 custom rows and that extends SimpleAdapter. Each row consist
I have a listview with custom rows. In the row there are these items:
I have a custom listview which changes size when one of the rows is
I have a ListView which contains custom rows. This custom row has following UI
I have a listView with custom rows containing buttons and I populate the listView
I currently have a custom listview with two rows of text in each item,
i have a listview with checkbox in each rows. i'm using custom cursoradapter and
I have a custom ListView Adapter , with which I'm creating rows for a
I have a listview which contains custom rows. When I show the listview with
i got the following problem. i have a ListView with custom rows consisting of

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.