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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:38:13+00:00 2026-05-22T11:38:13+00:00

When I set an icon or an image as a background for a button,

  • 0

When I set an icon or an image as a background for a button, I always see something like this :
enter image description here

as you can see, the images are smeared (2 images on left side, and 2 images on right side)
Here is the code on how I added the icons(it’s the defaults icon from android.R.Drawable…)

btnDown.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.arrow_down_float));
btnUp.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.arrow_up_float));
delete.setBackgroundDrawable(myIcon);
btnOk.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.ic_menu_save));

can someone tell me how to set icon/image on background correctly ? Without them being smeared . if the icon is 32×32, I want see it on button.

  • 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-22T11:38:14+00:00Added an answer on May 22, 2026 at 11:38 am

    may be your image is too small thats why its looking like smeared …use nine patch scaled image this will help you

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

Sidebar

Related Questions

How can I set a jquery ui icon as a background image per a
How does one set the CSS background-image property to just load one particular icon
I am trying to set a image as a background of a button through
Is possible to set an image as an iPhone application unique icon in code
I'd like to know what's the way to actually set the icon of a
In Linux, can one set a custom icon for a folder/directory as it appears
When compiling with gmcs on Linux, how can I set the explorer icon the
<a class=success href=javascript:void(0)></a> //CSS for setting background for above link a.success:hover{ //set background image
i tried to set image to the button tag in asp.net but it gave
I have an icon set that uses CSS classes to display them accordingly. Like,

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.