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

The Archive Base Latest Questions

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

Well.. I have some ImageButtons in my Android application. I want them to display

  • 0

Well.. I have some ImageButtons in my Android application. I want them to display the full picture. I mean: I want the ImageButton to be JUST the picture, you know?

Ok… so far, so good… I can do it use the property “background”.

However I also want the ImageButton to have the corners rounded.

I have the following xml in my layout folder:

    <?xml version="1.0" encoding="UTF-8"?>
        <shape xmlns:android="http://schemas.android.com/apk/res/android">
            <solid android:color="#FFFFFFFF"/>
            <corners android:radius="10dip"/>
            <stroke android:width="8dip"/>
        <size android:height="8dip"/>    
        </shape>

It works perfect when I don’t want the picture to fill the WHOLE ImageButton… however when I try to use the picture to use the whole imagebutton… it doesn’t show the rounded corners.

Can anyone help me, please?

Bonus question: Also, how can I have a beautiful black line (rounded corners) around the imagebutton?

  • 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-26T17:30:13+00:00Added an answer on May 26, 2026 at 5:30 pm

    I can suggest you to use ImageView instead of ImageButton and catch its onClick().And you can use this xml file to give it a fine black rounded edges outline to your image:

    image_bg.xml:(paste this xml file in drawable folder)

    <?xml version="1.0" encoding="UTF-8" ?> 
      <shape xmlns:android="http://schemas.android.com/apk/res/android">
      <solid android:color="#000000" /> 
      <stroke android:width="3dp" android:color="#776da8" /> 
      <corners android:bottomRightRadius="5dp" android:bottomLeftRadius="5dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" /> 
      <padding android:left="2dp" android:top="2dp" android:right="2dp" android:bottom="2dp" /> 
      </shape>
    

    You can use it (in xml file where you have added the image) like:

    <ImageView android:layout_width="wrap_content"
               android:layout_height="wrap_content"
               android:id="@+id/image" 
               android:src="@drawable/icon"
               android:background="@drawable/image_bg" /> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say you have some tabular data you want to display, as well as allow
I know java well, and have some experience in EclipseLink, Hibernate, JSF, Grails and
well i have a listbox with some items inside. i want to detect a
I have an application written in C# that invokes some C code as well.
Well, I have a application which somehow requires some system resources, but how do
We have some Well-Attributed DB code, like so: [Display(Name = Phone Number)] public string
I have some non well-formed xml (HTML) data in JAVA, I used JAXP Dom,
I have some login code that works well for Firefox and other browsers, but
I have done some project in Irrlicht and it compiles all well, however when
I have requirement where some times I would like to load children as well

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.