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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:57:52+00:00 2026-06-07T16:57:52+00:00

I have a vertical linear layout and I want to add a background the

  • 0

I have a vertical linear layout and I want to add a background the text view. I am using 9 patch which I’ve done for buttons no problem. My 9 patch graphic is correct but this is what get when its displayed in the layout. The numbers are supposed to be evenly spaced. If I don’t put the 9 patch there the layout displays fine (one field gets pushed out of view). What is going on here? I don’t want to hard code the height of the textview, hence why I am using a 9Patch.

Bad 9 Patch!

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rl_DisplayGraph"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:id="@+id/rl_DisplayFeatures"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:orientation="vertical" >

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="1"
            android:textColor="@color/orange1"
            android:textSize="20dip" />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="2"
            android:textColor="@color/orange1"
            android:textSize="20dip" />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="6"
            android:textColor="@color/orange1"
            android:textSize="20dip" />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="3"
            android:textColor="@color/orange1"
            android:textSize="20dip" 
        />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:background="@drawable/back_graphtab"
            android:text="4"
            android:textColor="@color/orange1"
            android:textSize="20dip" />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="5"
            android:textColor="@color/orange1"
            android:textSize="20dip" />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="7"
            android:textColor="@color/orange1"
            android:textSize="20dip" 
            android:longClickable="true"/>

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="8"
            android:textColor="@color/orange1"
            android:textSize="20dip" />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="9"
            android:textColor="@color/orange1"
            android:textSize="20dip" />
    </LinearLayout>

    <!--More layouts here but cut short for brevity ->

</RelativeLayout>

9Patch image

  • 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-07T16:57:54+00:00Added an answer on June 7, 2026 at 4:57 pm

    Your initial 9-patch size is larger than the minimum size that you want your buttons to be.

    Example

    Try something like the attached; reduce it to the smallest possible size without eliminating information that you need.

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

Sidebar

Related Questions

I have a linear layout with a couple text boxes, vertical. I want to
I have a Horizontal Layout in which some vertical layouts are dispatched. I want
I have a vertical linear layout with two ListViews. I want the top ListView
I want to add a webview to my layout.But that layout have few other
I have a problem that, I want to add a textView or a button
Hy! I want to have have a layout like this: The problem is i
hi I have a activity with three vertical linear layout with respective layout_weight with
I have a problem about RelativeLayout,i dunno know how to add a scrollview,i want
I have a simple vertical LinearLayout in which there is a button on the
Desired Outcome I want to have Vertical List with custom items on the left/right

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.