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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:40:52+00:00 2026-06-16T05:40:52+00:00

I have an Android activity which has three buttons. I have set a color

  • 0

I have an Android activity which has three buttons. I have set a color for the main activity LinearLayout‘s background via:

android:background="@color/homeBgColor"

I want to put up a translucent background image behind the buttons on the activity. I tried using an ImageView, but it pushes the buttons down.

Is there any way to set the background color as well as image for the activity, like we do in CSS?

#mydiv{ backround: #262626 url("link-to-my-img.png");}

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-16T05:40:53+00:00Added an answer on June 16, 2026 at 5:40 am

    You should be able to achieve this with a <layer-list /> drawable. Within it, place an <item /> which contains a <bitmap /> (example stolen from the developer docs):

    <item>
        <bitmap android:src="@drawable/image"
                android:gravity="center" />
    </item>
    

    Then, your other item can just be a solid color. Make a drawable resource that just has that solid color in it, then combine them:

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:drawable="@drawable/your_color" />
        <item>
            <bitmap android:src="@drawable/image"
                    android:gravity="center" />
        </item>
    </layer-list>
    

    (You may have to flip the order of the <item /> tags, I forget which is on top.)

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

Sidebar

Related Questions

I have three activities in my android app. First activity is main application screen
I have a project which has gui consisting of three buttons.Now one of these
I have an android application that has a background service which polls a web
I am developing an activity which have an Update button as menu for android.
I have some problem with Android AsyncTask. There is an Activity which contains some
I have an Android app which includes an activity called Help This uses a
I am new to Android development. I have an activity in which I would
I have a login page (an activity in Android), during which I run an
I have a ListView on my Android Activity. When I scroll it, the background
I have an android app where in my Main activity I can play music

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.