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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:26:49+00:00 2026-05-26T03:26:49+00:00

In my application I want to apply gradient to Button. I have written following

  • 0

In my application I want to apply gradient to Button. I have written following code and the result is perfect.

<?xml version="1.0" encoding="utf-8"?>

<layer-list 
xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape>
            <padding 
                android:left="1dp"
                android:top="1dp"
                android:right="1dp"
                android:bottom="1dp"/>

            <solid 
            android:color="#FF000000"/>

        </shape>
    </item>

    <item>
        <shape>
            <padding 
            android:left="5dp"
            android:top="5dp"
            android:right="5dp"
            android:bottom="5dp"/>

            <gradient 
            android:startColor="#FFB0B0B0"
            android:centerColor="#FFFFFFFF"
            android:endColor="#FFB0B0B0"
            android:angle="315"/>

            <corners 
            android:radius="3dp"/>
        </shape>
    </item>


</layer-list>

But my problem is, when I click on this button I have no effect or animation such as original one. Therefor, I want to add some effect on it that when user clicks on it the button becomes bigger and when released the key, the button comeback to its situation.

guide me please. thanks 🙂

  • 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-26T03:26:50+00:00Added an answer on May 26, 2026 at 3:26 am

    This is for only background of button but you have not specified anything for different events like click, hover, etc.

    For that you have to create another set of styles and set them in selector as in my previous answer and make that selector as background of your button

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

Sidebar

Related Questions

I have the following gradient_bg.xml: <?xml version=1.0 encoding=UTF-8?> <shape xmlns:android=http://schemas.android.com/apk/res/android android:shape=rectangle> <gradient android:type=radial android:gradientRadius=200
I have an idea and I want to apply it to my Application (C#
I have a sencha touch application, but want to apply a loading mask to
I want to write a web application and want to use Ruby. I have
I'm implementing a message application using CouchDB. I want to apply timestamps to each
I have one application in which I want to pass data between Pages (Views)
I have written a small client server socket application. It is a proof of
I want to apply different borders to image in my iphone application. I am
i am developing an iphone application in which i want to apply table view
I want to apply pagination for some class of my application, in which i

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.