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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:23:13+00:00 2026-05-21T15:23:13+00:00

An instance of ImageView in a RelativeLayout with height set to fill_parent will stretch

  • 0

An instance of ImageView in a RelativeLayout with height set to fill_parent will stretch as the RelativeLayout does. E.g. if an EditText in the same layout is 10 lines tall, the image will stretch to 10 lines tall.

How can this behavior be replicated in a FrameLayout? The image’s height set to fill_parent seems to behave the same as wrap_content, regardless of the height of the other items in the FrameLayout.

I’d prefer to handle this purely in the XML.

  • 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-21T15:23:14+00:00Added an answer on May 21, 2026 at 3:23 pm

    I found a (possibly hack) workaround- wrapping the FrameLayout in a LinearLayout let me set the FrameLayout to fill_parent and so its children could stretch accordingly. So:

    <LinearLayout
    orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <FrameLayout
            android:measureAllChildren="true"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            <EditText
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />
            <ImageView
                android:src="@drawable/image"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:scaleType="fitXY"
                android:layout_gravity="right|center_vertical" />
        </FrameLayout>
    </LinearLayout>
    <RelativeLayout ... >
        ... other stuff ...
    </RelativeLayout>
    </LinearLayout>
    

    And the ImageView will stretch to the height of the EditText.

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

Sidebar

Related Questions

For instance, does the compiler know to translate string s = test + this
I have a RelativeLayout defined in an xml layout file named 'myview.xml' which contains
I have a ListView that has one image and two lines of texts for
set a UIImageView.image property to a UIImage is unable add the image to the
Sorry for bugging you again, but how do I instance an ImageView ( or
I have an application in which I am displaying image in my imageview which
I have Class A with an instance variable ImageView. Currently I use setTag() to
instance Monad (Either a) where return = Left fail = Right Left x >>=
For instance, my query is like the following using SQL Server 2005: SELECT *
An instance of class A instantiates a couple of other objects, say for example

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.