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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:35:22+00:00 2026-06-03T14:35:22+00:00

Is it possible to achieve something like this: I have one picture to set

  • 0

Is it possible to achieve something like this:
I have one picture to set as a background on layout in which is also TextView. So I want that layout to set his height to wrap content (which should be the height of TextView) and ImageView to has fill_parent as height and width.

I tried using:

  • LinearLayout with background and TextView
  • TextView with background
  • RelativeLayout with ImageView (set height to fill_parent) and TextView (set to wrap_content)

Is there a way to do this?

Sorry, if it’s next question about the same, but I have no idea how to find a solution.

EDIT:

I’ll try to be more specific. I want a TextView with background. But I want that background to be scaled to fit TextView which should be wrap_content width and wrap_content height. But I have image in higher resolution so there is a lot of unused space (background doesn’t scale).

  • 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-03T14:35:24+00:00Added an answer on June 3, 2026 at 2:35 pm
    1. No, there is no way to set a view’s width/height to both wrap_content and fill_parent simultaneously.

    2. What exactly are you trying to achieve? Is this what you mean?

      <LinearLayout 
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          ...
          android:background="@drawable/image" >
      
          <TextView 
              android:layout_width="wrap_content"
              android:layout_width="wrap_content"
              ... >
          </TextView>
      
      </LinearLayout>
      

    EDIT

    If you want to nicely scale a background image for a TextView, I think what you might want to look into is a 9-patch image. See this post for more info. Also this.

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

Sidebar

Related Questions

I want to achieve something like this: class C { int m_nVal; public: C(int
I don't know if it's possible but i want to achieve this: i have
Is there any possible way to achieve this? For instance, I have an I/O
I'm not sure if this is possible what I'm trying to achieve. I want
I have a table that looks like something like this: timestamp value person ===============================================
I want to achieve a syntax similar to this one using JS setters and
I am using the patch queue to achieve something like what this person asked
I have a SortableListView of which I set the ItemsSource via a binding. Something
I have table consisting of notes for every user which looks like this: user_id
Is it possible to achieve cross browser (ie6+) semi-transparent borders with a solid background

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.