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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:01:43+00:00 2026-06-04T01:01:43+00:00

I have the following simple layout <?xml version=1.0 encoding=utf-8?> <ScrollView xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content >

  • 0

I have the following simple layout

    <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <RelativeLayout
        android:id="@+id/answerMainFrame"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@color/background"
        android:isScrollContainer="true"
        android:onClick="toAnswer" >

        <ImageView
            android:id="@+id/answer_img"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            android:contentDescription="@string/question_img_cd" />

        <TextView
            android:id="@+id/answer"
            style="@style/Question"
            android:layout_below="@id/answer_img" />
    </RelativeLayout>

</ScrollView>

but sometimes, depending on the size of the ImageView and TextView, it doesn’t fill the height of the screen. That’s ok. I just want the rest of the screen to be white instead of black.

I’ve tried setting android:background="@color/background", which is white, to the ScrollView but I get the same.

I’ve also tried setting android:layout_height="wrap_content" to the Relativelayout but it shows a warning.

What should I do?

Thanks.

  • 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-04T01:01:44+00:00Added an answer on June 4, 2026 at 1:01 am

    Change the ScrollView height to match_parent and set a white color as background. So something like this according to your code:

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
                      android:layout_width="fill_parent"
                      android:layout_height="match_parent"
                      android:background="@color/background">
    ...
    

    Note.
    The warning about the RelativeLayout can be easily explained. If you set it’s height to wrap_content it’s unable to do so because the elements its holding inside require a fixed set of dimensions for its parent to be able to do things such as attach to the bottom, or center or whatever.

    I also had some confusion around this at first.

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

Sidebar

Related Questions

I have the following layout for my ImageView : <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following code in resultlookup.xml <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:id=@+id/layoutResultOuter
I have the following LinearLayout with a GridView in it: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=match_parent
I have a very simple Android activity layout like this: <?xml version=1.0 encoding=utf-8?> <LinearLayout
I have a simple LinearLayout in Android with two images vertically: <?xml version=1.0 encoding=utf-8?>
All, I have the following in my string resource xml file. <?xml version=1.0 encoding=utf-8?>
I have the following XML layout: <LinearLayout android:id=@+id/map_locations_list android:layout_width=300dp android:layout_height=fill_parent android:layout_marginLeft=8dp android:layout_marginTop=8dp android:layout_marginBottom=8dp android:background=@color/black_shadow
I have a simple table layout in the .xml file. I am adding components
I have following simple class: @interface Article: NSObject { NSString *title; } @property (copy,
I have following simple program: import std.stdio; int main(string[] argv) { writeln(Hello, world!); return

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.