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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:45:50+00:00 2026-06-14T20:45:50+00:00

Now the button is round corner and filled with solid green when not pressed,

  • 0

Now the button is round corner and filled with solid green when not pressed, and become solid blue with round corner when pressed. Codings are as follows:

I would like to ask how could the following be modified if I want

  1. set background images for pressed and not pressed for the button instead of solid blue and green
  2. how could I add paddings to the button because now all the buttons are sticking to each other.. I have declared padding in xml but not successful

In xml:

    <Button
        android:id="@+id/buttonC"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_span="4"
        android:background="@drawable/story_btn"
        android:onClick="buttonC_click"
        android:padding="2dp"
        android:text="abc"
        android:textSize="20dp" />

In story_btn.xml

<item android:state_pressed="true" >         
    <shape xmlns:android="http://schemas.android.com/apk/res/android"> 
        <stroke android:width="5dp" android:color="@color/red" />
        <solid android:color="@color/blue"/>
        <padding android:left="5dp" android:top="2dp" 
            android:right="5dp" android:bottom="2dp" /> 
        <corners android:radius="15dp" /> 
    </shape>    
</item>

<item>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"> 
        <stroke android:width="2dp" android:color="@color/black" />
        <solid android:color="@color/green"/>
        <padding android:left="5dp" android:top="2dp" 
            android:right="5dp" android:bottom="2dp" /> 
        <corners android:radius="15dp" /> 
    </shape>
</item>

  • 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-14T20:45:51+00:00Added an answer on June 14, 2026 at 8:45 pm
    1. In your story_btn.xml, instead of specifying a shape for each item, specify a drawable like android:drawable=”@drawable/activity_active”.
    2. Use Layout_margin to specify the margin between the buttons.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Normal button looks like: Now, please let me know, How can i make a
I'm trying to POST a PayPal or GoogleCheckout buy now button from the code
I am using the following code to generate a Buy Now button for selling
http://ano-mag.com/black-foil/ please check this url - click the Order Now button on the left
hi there Iam creating a Paypal IPN and i have a pay now button
Right now when I run this it keeps clicking on the same button every
I have created a shiny button in photoshop and now wish to use it
Right now I have a single sound playing from one action, button press, accelerometer,
Ive been trying unsuccessfully for a few days now to get a button to
Suppose user taps on a button and video begins to play. Now when video

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.