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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:54:14+00:00 2026-05-26T00:54:14+00:00

I have a RelativeLayout where I need to have a black background and a

  • 0

I have a RelativeLayout where I need to have a black background and a small image exactly in the middle of it. I used this code:

  <RelativeLayout
    android:id="@+id/bottomBox"
    android:layout_weight="4"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bottom_box_back"
    android:layout_marginTop="4dp"
    />

where the @drawable/bottom_box_back is:

<bitmap 
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/logo_icon"
android:tileMode="disabled"
android:gravity="center"
android:filter="true"
/>

In this way I have the image centered. But the background is still gray as the main window. I need a black back to the image spread all over the RelativeLayout space. Any suggestions?

  • 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-26T00:54:15+00:00Added an answer on May 26, 2026 at 12:54 am

    I would make the background of your RelativeLayout black and then put the Image into an ImageView and center that in the middle of the RelativeLayout, so:

    <RelativeLayout
        android:background="@color/yourBlackColor">
    
        <ImageView
            android:layout_centerInParent="true">
        </ImageView>
    
    </RelativeLayout>
    

    Hope this helps you

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

Sidebar

Related Questions

I have a dialog with this content: <RelativeLayout android:layout_width=wrap_content android:layout_height=wrap_content > <ScrollView android:layout_width=fill_parent android:layout_height=wrap_content
I have an ImageButton. The code is - ImageButton shareButton = new ImageButton(this); shareButton.setBackgroundResource(android.R.drawable.ic_menu_share);
i need to implement this layout in android..the view must be have two list
I have a RelativeLayout with a TextView in the middle. I've got it to
I have a RelativeLayout with one child as <include another.xml> like this root.xml :
This seems simple but I've exhausted my Google search patience. I have a RelativeLayout
In my foo_layout.xml file I have a subclassed RelativeLayout: <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android
What is the color code of black with 85% opacity? I have #65000000 -
I have a relativelayout which contains a progressbar and a Loading textview ..i need
I have TextView in RelativeLayout, which works properly: <TextView android:id=@+id/tv_client_in android:layout_width=wrap_content android:layout_height=wrap_content android:layout_above=@+id/tv_label_client_out android:layout_alignParentLeft=true

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.