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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:58:21+00:00 2026-06-14T19:58:21+00:00

The app I am developing have a background image which I would like to

  • 0

The app I am developing have a background image which I would like to have scaling to the different device sizes, most important it should fit the width. The background fades into black, so I can have a permanent black background on the main view and that looks just fine.

I have made a background.xml file, and at the moment I have only the xlarge background image of 800×1280 px graphic in the res folder. When I run my app on a AVD with the settings of the Samsung Galaxy S3 the background width do not fill the entire screen, yet the rest of the controls scales just fine to the screen.

This is the start of my view:

<ScrollView android:id="@+id/MainScrollView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:background="#000000" 
    android:orientation="vertical"
    android:fillViewport="true">

<LinearLayout
    android:id="@+id/lineLayout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:background="@drawable/background"
    android:orientation="vertical"> 

My background.xml looks like this:

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
android:src="@drawable/mainappbg" 
android:gravity="top|left" android:filter="true" android:dither="true" />

Hope someone can help.

Thanks

I have tried this, there is an image inserted as background but only the TasksButton and ServiceRapportButton are visible, the rest of the content disapears.

<ScrollView android:id="@+id/MainScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:background="#000000" 
android:orientation="vertical"
android:fillViewport="true">

<RelativeLayout 
   android:layout_width="fill_parent" 
   android:layout_height="fill_parent">
  <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:src="@drawable/mainappbg"/>

<LinearLayout
android:id="@+id/lineLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<RelativeLayout
    android:id="@+id/RelativeLayout1"
    android:layout_width="fill_parent"
     android:layout_height="85dp">
   <Button android:id="@+id/TasksButton" android:layout_width="wrap_content"      android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginRight="5dp" android:layout_marginTop="5dp" android:background="@drawable/opgaver" android:onClick="TasksClickHandler" android:textSize="12sp"/>
   <Button android:id="@+id/ServiceRapportButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginRight="15dp" android:layout_marginTop="40dp" android:background="@drawable/rapport" android:onClick="ServiceRapportClickHandler" android:textSize="12sp"/>       
</RelativeLayout>
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tableLayout1">
      <Button android:id="@+id/LineButton" android:layout_weight="1" android:layout_width="0dp" android:layout_height="match_parent" android:background="@drawable/lines" android:onClick="LineClickHandler" android:textSize="12dp"/>        
      <Button android:id="@+id/ServiceButton" android:layout_weight="1" android:layout_width="0dp" android:layout_height="match_parent" android:background="@drawable/service" android:textSize="12dp" android:onClick="ServiceClickHandler"></Button>
      <Button android:id="@+id/NavigationButton" android:layout_weight="1" android:layout_width="0dp" android:layout_height="match_parent" android:background="@drawable/navigate" android:textSize="12dp" android:onClick="NavigateClickHandler"></Button>         
</LinearLayout>

Edit, added screenshot, I want to place a background behind these controls:
Screenshot of app screen

  • 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-14T19:58:22+00:00Added an answer on June 14, 2026 at 7:58 pm

    If the only purpose of LinearLayout (@id/lineLayout1) is to serve as bg container, then replace it with ImageView set android:scaleType to match scaling results you want to achieve.

    EDIT

    Wrap it in RelativeLayout layout and put ImageView as BG container:

    <ScrollView
       xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/MainScrollView"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent" 
       android:background="#000000" 
       android:orientation="vertical"
       android:fillViewport="true">
    
       <RelativeLayout 
           android:layout_width="fill_parent" 
           android:layout_height="fill_parent">
          <ImageView 
              android:id="@+id/imageView1" 
              android:layout_width="fill_parent" 
              android:layout_height="fill_parent" 
              android:src="@drawable/beta_bg_drawable"/>
    
            <LinearLayout 
                android:layout_width="fill_parent" 
                android:layout_height="fill_parent" 
                android:background="#5500ff00" 
                android:orientation="vertical">
            </LinearLayout>
    
       </RelativeLayout>
    
    </ScrollView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am developing a iphone app. i have a background image lets say an
I have been developing an app in VB.NET which requires a control object (for
I am developing an app in which I have a table. In the table
I'm developing an App in which i have to record a song and a
I learning Python (coming from a dotnet background) and developing an app which interacts
Background: As I'm developing an app that needs to be run on a device,
I am developing app using the jquerymobile framework. I have to set the background
I am developing an app that should have similar functionalities as the game in
I am developing an app, which needs to use images that have a resolution
I have been developing a windows store app, where I need something like Periodically

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.