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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:45:45+00:00 2026-05-29T18:45:45+00:00

On an Android Activity, I want to set an image as the background in

  • 0

On an Android Activity, I want to set an image as the background in the bottom left corner. Here’s how you do it: Background Image Placement

However, I also want to be able to specify that the rest of the background which is not this image has a certain color. Is this possible?

(It’s so I can have a background which is one solid color with a small logo in one corner)

Thanks,

EDIT:
I have done a test project which apparently should work, but it crashes for me. https://github.com/jarofgreen/AndroidTestBackground E/AndroidRuntime(213): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class

  • 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-29T18:45:47+00:00Added an answer on May 29, 2026 at 6:45 pm

    I solved this by using a 9-patch image.

    http://developer.android.com/guide/developing/tools/draw9patch.html

    I made a 9-patch image with a wide area of background color and set the background color as the expandable area.

    9-patch

    Then just set this image as the background of the view!

    (One thing I don’t understand tho, I thought content would only be placed in the expandable area, leaving a wide margin on the left and bottom. We were going to accept that as a necessary sacrifice but actually content appears over all parts of the background. )

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

Sidebar

Related Questions

I want to set the Image to be Selected from the Android Gallery. I
I want to set the background of the standard TextView in an Android project
I also want to be able to change the image programmatically so that I
Here is my code import org.ksoap2.*; import org.ksoap2.serialization.*; import org.ksoap2.transport.*; import android.app.Activity; import android.os.Bundle;
I am beginner to Animation in Android. I want to set animation like Pendulum(Swing
I am able to open my image from SD card in gridview and also
In my android project I have an image that i want to rotate it
I've been trying to use an android preference activity, I got it all set
I'm quite new to android, but basically I want to set up a program
Aim :- to set background image in my application that fills the device both

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.