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'm programming an Android calculator in Eclipse. I want to be able to set
I want to set the Image to be Selected from the Android Gallery. I
I also want to be able to change the image programmatically so that I
I have set the background of my activity by doing: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent
I want to display html in android activity through web view,my screen will be
I want to call a method say success(message) of javascript from android activity. I
I am making an android app. I have a main activity and i want
When a user downloads a file using Android I want my custom activity to
in my Activity, i want to take a picture with android.hardware.Camera. The code (see
I am able to open my image from SD card in gridview and also

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.