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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:29:49+00:00 2026-06-17T11:29:49+00:00

I have set up some buttons with icons on the left and text on

  • 0

I have set up some buttons with icons on the left and text on the right. Everything scales with screen size (phone tablet) but the problem is that the button is just the text. I want the button to be the entire line so that the button that has focus lights up correctly (I use a remote).

This code works except for the button is just the text

        <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:onClick="onSetTargets">

    <ImageView
            android:id="@+id/imageView1"
            android:layout_width="@dimen/menu"
            android:layout_height="@dimen/menu"
            android:layout_marginTop="@dimen/padding_small"
            android:src="@raw/target" 
            android:onClick="onSetTargets"/>

    <Button
        android:id="@+id/set_Targets"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonselector"
        android:ellipsize="none"
        android:gravity="left"
        android:onClick="onSetTargets"
        android:singleLine="true"
        android:text=" Targets "
        android:textColor="@android:color/white"
        android:textSize="@dimen/menu" />

    </LinearLayout>

This is just a section within a linear layout and there are then several buttons in a row.

Following is what I would like to get working but I can’t figure out how to scale the drawable. I know there is a scaleDrawable command but I can’t find any posts on how to make it work in the XML other than people complaining that it doesn’t work and getting solutions for dealing with it in java.

        <Button
        android:id="@+id/set_start_time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/buttonselector"
        android:gravity="left"
        android:onClick="onStartTime"
        android:text=" Timer"
        android:textColor="@android:color/white"
        android:textSize="@dimen/menu" 
        android:drawableLeft="@raw/hourglass"/>
  • 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-06-17T11:29:50+00:00Added an answer on June 17, 2026 at 11:29 am

    This is what I came up with that worked. The overall page is a linear layout with buttons arranged vertically on the page. Each button is a vertical linear layout consisting of an image and some text. All elements of the vertical layout are clickable so clicking on the image or the text does the same thing. Here is an example for a single button. The size @dimen/menu is defined for both phone and tablet sizes and the image will scale to match the specification.

            <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" 
            android:onClick="onSetTargets">
    
        <ImageView
                android:id="@+id/imageView1"
                android:layout_width="@dimen/menu"
                android:layout_height="@dimen/menu"
                android:layout_marginTop="@dimen/padding_small"
                android:src="@raw/target" 
                android:onClick="onSetTargets"/>
    
        <Button
            android:id="@+id/set_Targets"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonselector"
            android:ellipsize="none"
            android:gravity="left"
            android:onClick="onSetTargets"
            android:singleLine="true"
            android:text=" Targets "
            android:textColor="@android:color/white"
            android:textSize="@dimen/menu" />
    
        </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of buttons in a table each with some text. I
I have a set of radio buttons. In some cases I want the user
I have a floated span with some text. I have set the overflow to
I have some Buttons on my android app. They have an icon and text.
I have a bunch of buttons in my JToolBar, and I set some of
I have some buttons I'm trying to have rotate 45 degrees on click, but
In my init I have set some variables and one animate that uses those
I have one AlertDialog which is working fine.I have set some background images to
I have to set some routing rules in my php application, and they should
I have some set of xml generated via xmlserialization of some WCF messages. Now

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.