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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:40:59+00:00 2026-05-27T05:40:59+00:00

I have a button where I put a picture … I must try to

  • 0

I have a button where I put a picture … I must try to resize the image inside the button … how can I resize it? Can I do it directly from the xml code?
This is the xml code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/layout_root"
        android:orientation="vertical"
        android:layout_width="250dp"
        android:layout_height="180dp"
        android:paddingLeft="4dip"
        android:paddingRight="4dip"
        android:background="@color/white_trasparent"
        android:weightSum="1">

    <TextView 
        android:layout_height="wrap_content" 
        android:id="@+id/text" 
        android:textColor="@color/grey" 
        android:textAppearance="?android:attr/textAppearanceLarge" 
        android:layout_width="wrap_content" 
        android:layout_marginLeft="15dp">
        </TextView>
    <Button 
        android:layout_width="wrap_content" 
        android:text="Drawable Top" 
        android:id="@+id/Button03" 
        android:drawableTop="@drawable/icon" 
        android:layout_height="wrap_content" 
        android:textSize="10dp">
        </Button>
</LinearLayout>
  • 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-27T05:40:59+00:00Added an answer on May 27, 2026 at 5:40 am

    if my understanding of the drawableTop/left/bottom/right properties is correct that is not going to place your image inside your button, rather it is going to put it on top (north of) your button.

    If you’re looking to put an image inside a button check out ImageButton.

    I don’t think either of these things will let you just set the size of only your image though (they will let you change the size of the whole view, in this case the rectangle button box, and the image inside it.)

    In order to change the size of the image without affecting the size of the button box graphic I think you’d have to shrink your resource image in photoshop or something.

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

Sidebar

Related Questions

I am in vb6, behing a button i have put this code: hwnd is
As suggested by Apple, I have put a button on my application, to restore
I have button, which fires an event, that deletes a record from the database.
am trying to goto a page from main window by using I have put
I have built a layout that can display a picture on three different areas.
I am trying to code this from scratch, so that when a button clicked
I have button with name itemname, and now I want to put underline just
I have menu button that is being put in the Navigation controller on every
I need to put small icon inside button in HTML (for example I need
I have some code where I have a button that I'd like to create

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.