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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:33:49+00:00 2026-06-06T04:33:49+00:00

I have an activity, I’ll call it mainactivity for now. And I want to

  • 0

I have an activity, I’ll call it mainactivity for now. And I want to know how to put a background onto it. I know how to add the background by adding android:background="@drawables/background"

But I want to align it to the bottom right (Gravity) and keeps it’s original ratio because the background tag is stretching it

This is what I have got so far. A styles.xml file and the background tag on the linear layout set to @style/Background

Styles file:

        <style name="Background">
    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/background" 
        android:gravity="bottom|right"
/>
    </style>

What do I add/change (or anything else I could do) to make the drawable ‘lock’ to the bottom right corner?

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-06T04:33:51+00:00Added an answer on June 6, 2026 at 4:33 am

    You can create a new bitmap drawable that specifies a source drawable and a gravity, then use that drawable as background.

    For instance, create a new bitmap drawable named aligned_background.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
        android:gravity="bottom|right"
        android:src="@drawable/background" />
    

    and then set your background to @drawable/aligned_background.

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

Sidebar

Related Questions

I have Activity A with android:launchMode=singleTop in the manifest. If I go to Activity
in my app i have activity with XML layout, i want to build an
I have an activity with a spinner which loads a simpleCursorAdaptor. I call another
I have activity A in package one, and I want to run an intent
I have a custom dialog in my android application. I want to have in
I have an Activity named whereActity which has child dialogs as well. Now, I
I have activity with MapView, TextView, 3 ImageButton and 1 simple Button. First call
Possible Duplicate: Finish the calling activity when AsyncTask completes I know that I have
That's the cuestion , i have: Activity A Activity B From A i want
I have activity with android:configChanges=orientation|keyboardHidden I am trying to change image in ImageView when

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.