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

The Archive Base Latest Questions

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

I am trying to add a background image to a view. The image is

  • 0

I am trying to add a background image to a view. The image is really wide and not so tall. It’s 6400 x 480. I want the image to fill the android screen’s height and keep it’s aspect ratio. I cannot seem to get this to work.

<ImageView
    android:id="@+id/background"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/background"
    android:scaleType="fitStart"
    android:layout_alignParentBottom="true" />

Keep in mind I have tried all options with scaleType and it just doesn’t give the desired effect. I want to be able to move the image to the left revealing the rest of the image later on.

Any advice, tips would be great! Maybe I am going about this the wrong way.

  • 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-31T20:34:22+00:00Added an answer on May 31, 2026 at 8:34 pm

    I ended up finding the solution myself. I created an XML file named background.xml in my drawables folder and placed this code in it:

    <?xml version="1.0" encoding="utf-8"?>
    <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
        android:src="@drawable/background_image"
        android:tileMode="disabled" android:gravity="top|left|fill_vertical">
    </bitmap>
    

    Which created a bitmap object for use. I then add this android:background="@drawable/background" to my RelativeLayout tag in my main.xml.

    Worked like a charm

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

Sidebar

Related Questions

Hi I am trying to add background image to my link. The image contains
I am trying to add a background image to UITableViewCell using the following code:
I'm trying to use the android.R.drawable stat_sys_download as the background image for a text
I am trying to add a background image to a listActivity in my app.
I'm trying to add an in-background alarm clock feature to an app I'm developing.
I am trying to add watermark with transparent background on OSX with ffmpeg. I
I'm trying to add a gradient to the background of a LinearLayout, and it
I'm trying to add an overlay to a MapView from a background thread to
I am working with the Mojo SDK and I'am trying to add a background
I am trying to add a small image in a row of my ExpandableList.

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.