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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:30:04+00:00 2026-05-26T12:30:04+00:00

I am trying to use the 9-patch technique to create the button. It looks

  • 0

I am trying to use the 9-patch technique to create the button.

It looks almost great in the Layout Window of Eclipse

Eclipse layout

When I run it in the emulator it shows up like this:

Emulator view

Here is the actual PNG image

Actual PNG

Selector XML

<item android:drawable="@drawable/splash_facebook_button" />

Button Code in Layout

   <Button
        android:id="@+id/button1"
        android:layout_width="208dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="20dip"
        android:background="@drawable/splash_facebook_button_selector"
        android:text="Sign up with Facebook" />
  • 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-05-26T12:30:05+00:00Added an answer on May 26, 2026 at 12:30 pm

    Looks to me like it’s not treating the image as a 9-patch. Have you saved it with the .9.png extension?

    Edit:
    Had a better look at the actual image and I don’t think you’ve quite got it set up correctly. The bottom and right border define where the content will go (in this case you want it over to the right, with a bit of padding).
    The top and left define the areas that will be stretched when the image is scaled. In this case you want it to be areas of constant blue that get stretched, rather than the logo. I’ve updated the image with an example of how to do this:

    Updated 9-patch

    This works for me!

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

Sidebar

Related Questions

I am trying to use rspec on my rails application I run spec path/to/spec/spec.rb
I was trying use a set of filter functions to run the appropriate routine,
I'm trying to use patch to return the a Mock from within a method.
I'm trying to use a 9-patch drawable as the background of a LinearLayout. when
I am trying to use a nine patch image as a background in an
I am trying to use mercurial in eclipse. I downloaded mercurial eclipse plugin for
I'm trying to create a patch using diff, but I can't get the patch
I am trying to create a custom-styled seekbar. I have two nine-patch images one
I am trying to use the attached nine patch image as the background for
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on

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.