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

  • Home
  • SEARCH
  • 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 8098945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:14:32+00:00 2026-06-05T22:14:32+00:00

I put a background to a TextView. I expect the background will adjust to

  • 0

I put a background to a TextView. I expect the background will adjust to my existing layout parameters and will not change the size of my TextView. So if I have width and height set to wrap_content, I would expect the background also wraps content (and scales down). But no, what I get is a bigger TextView

<TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="a"
    android:textColor="#ffffff"
    android:textSize="20sp"
    android:background="@drawable/large_bg"
/>

I get

enter image description here

…

How do I make that the background also obeys wrap_content?

I mean, this looks like the background would be treated as content…

  • 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-05T22:14:34+00:00Added an answer on June 5, 2026 at 10:14 pm

    This is because when we set background than textView or any Widget adjusts itself according to that background.Until and Unless we have not mentioned the Fix Height and Width[Its Poor approach]

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

Sidebar

Related Questions

I have a list: <ul> <li>Apple</li> <li>Banana</li> <li>Citrus</li> </ul> When I put a background
I have put image as background of button. but I don't know at what
I have a background that i put in my app and there are places
I want to put a background (width = 1250px) centered on page, but the
I have an expandablelistview and I have put a background for the groups item,
Under my relative layout, I put in a Textview and then a TextField (both
I would like to set a background of my main layout and put content
I have a vertical linear layout and I want to add a background the
I have 5 listviews which I would like to put in the same layout.
When I put a background image in my anchor, my anchor is changing it's

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.