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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:50:30+00:00 2026-06-17T05:50:30+00:00

How can we change the background colour of a Border less button when the

  • 0

How can we change the background colour of a Border less button when the button is pressed.

I used this:

    android:background="?android:attr/selectableItemBackground"
    android:text="@string/btn_skip" 

Where my button Displays a label “SKIP” as defined in my “strings.xml”.

Now When I test this it is Good Except It shows default “Blue” Colour when in Pressed State.
I want it to match it with other elements of my My UI theme that are “Orange” “#FF8800”

Any Ideas?

Thankx in advance…!

  • 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-17T05:50:32+00:00Added an answer on June 17, 2026 at 5:50 am

    Thanks @Nimish-Choudhary …! I followed your advice. and I have explained it further for clarity to all having same question as me as a beginner.

    Create an xml with name say "btntransparent.xml"

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android"
        android:dither="true">
    
    <item 
        android:state_pressed="true"
        android:drawable="@color/pressed"/>
    <item 
        android:state_enabled="false"
        android:drawable="@color/defaultColor"/>
    <item
        android:drawable="@color/defaultColor"/>
    
    </selector>
    

    Next add the colors "pressed" and "defaultColor" to another xml say "colors.xml"

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <color name="pressed">#CCFF8800</color>
        <color name="defaultColor">#00000000</color>
    </resources>
    

    Here "#CCFF8800" is my pressed state Translucent Orange and "#00000000" is the 100% Transparent Black (;-) thats invisible). You can find more about color codes at Color| Android Developers

    Now put the "colors.xml" in values Folder and "btntransparent.xml" in drawable Folder.

    Now the last step is to voila use it in the button as

    <Button
                android:id="@+id/id_btn_skip"
                android:background="@drawable/transparentbtn"
                android:onClick="skipToMain"
                android:text="@string/btn_skip" />
    

    And thats should do the job…!

    Take care.
    regards,
    raisedadead

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

Sidebar

Related Questions

I read this post but I can't get it working: Change Background Color... I
I want to change the colors of background button and the color of text
How can I change the BACKGROUND color of the MDI FORM in C#? I
Using AppleScript, how can I change the background color of cells ranging from A3
How I can change the individual region background color of viewport extjs 4. Here
here is the sample: http://jsfiddle.net/Zg55k/ How can I change css background image and color
How can I change the background of a single cell of a ListView? I
Can't change the body background for some reason, here is how I am trying
Background Large application with a bundle of code, I can't change the storage mechanism.
I'm looking to change the hue of my background image (PNG) programmatically. How can

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.