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
This is the scenario: I have one image background set on an activity. On
I have a RelativeLayout with a few TextView as children <RelativeLayout android:id=@+id/shift_parent_name android:layout_width=fill_parent android:layout_weight=0.25
i need to implement this layout in android..the view must be have two list
I have an ImageButton. The code is - ImageButton shareButton = new ImageButton(this); shareButton.setBackgroundResource(android.R.drawable.ic_menu_share);
I have this xml: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content style=@style/FragmentSecondary > <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent
I have this layout: <RelativeLayout android:layout_width=match_parent android:layout_height=match_parent > <ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/stat_brightness_off android:layout_toLeftOf=@id/brightnessSeekBar />
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

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.