user468311
user468311

Reputation:

Yet another 9patch drawable question

I've got relative layout in my view hierarchy and I want it to have this as background: enter image description here

Here's xml:

<RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/background"
        >
        <RelativeLayout
          android:layout_height="wrap_content"
          android:layout_width="fill_parent"
          >
          <TextView
           <!-- -->
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:paddingLeft="10dp"
           android:layout_centerVertical="true"
          />
          <Spinner
           <!-- -->
           android:layout_height="wrap_content"
           android:layout_width="wrap_content"
           android:layout_alignParentRight="true"
           android:minWidth="200dp"
          />
        </RelativeLayout>
        
        <!-- Nested Relative layouts as above go here -->
  </RelativeLayout>

And here's what I receive:

enter image description here enter image description here

It seems that 9patch causes the problem, because I tried other drawables and my layout didn't behave like this. Could you point me what's wrong?

Upvotes: 0

Views: 130

Answers (1)

darune
darune

Reputation: 959

Your padding doesn't seem right, the black part on right and bottom should be almost the entire width / height (except rounded corners).
I think it is the result your are waiting for.

Upvotes: 3

Related Questions