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

  • Home
  • SEARCH
  • 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 9242801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:39:40+00:00 2026-06-18T08:39:40+00:00

I am trying to put imageview and listview in two separate relative layouts, but

  • 0

I am trying to put imageview and listview in two separate relative layouts, but when I am adding image to imageview the height of image is less as it should be, it is adding some black space between image and listview. but when I put textview it works fine. here is code snippets ..

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout android:id="@+id/header"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight">
<ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_marginTop="-10dp"
        android:src="@drawable/bar" />

</RelativeLayout>

<ListView
android:id="@+id/list11"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="65dp"
android:cacheColorHint="#000000"
android:focusable="false"
android:listSelector="@color/itemcolor1"
android:scrollbars="vertical"
android:scrollingCache="false" >
</ListView>

</RelativeLayout>

Thanks guys, it is annoying

  • 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-18T08:39:41+00:00Added an answer on June 18, 2026 at 8:39 am

    try this…

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:weightSum="10"
    android:orientation="vertical"
     >
    <ImageView
            android:id="@+id/imageView1"
            android:layout_width="match_parent"
            android:layout_height="0dip"
           android:layout_marginTop="-10dp"
            android:scaleType="fitXY"
            android:layout_weight="2"
            android:src="@drawable/actionbar_background"
            android:adjustViewBounds="true"
            />
    
    <ListView
    android:id="@+id/list11"
    android:layout_width="fill_parent"
    android:layout_height="0dip"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/imageView1"
    android:cacheColorHint="#000000"
    android:focusable="false"
    android:layout_weight="8"
    android:scrollbars="vertical"
    android:scrollingCache="false" >
    </ListView>
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to set image on imageview but image is not show. I
I have two image views, which I am trying to put into a vertical
I am trying to put a scroll view to relative layout. Here some part
So I am trying to put two inline dropdown lists. I tested and it
I'm trying to put some custom list adapters into their own classes to make
I'm trying to put together a GUI for setting some pricing. There are three
I am trying to set rating to Ratingbar which is located in Listview but
I am trying to put a shadow around a thumbnail image on at tableview
I'm trying to put a copyright image in the bottom of my LinearLayout with
I've got the following code which should put an image in the top section/cell

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.