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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:03:10+00:00 2026-06-06T19:03:10+00:00

How do I make the background of a Textview about 20% transparent (not fully

  • 0

How do I make the background of a Textview about 20% transparent (not fully transparent), where there is a color in the background (i.e. white)?

  • 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-06T19:03:14+00:00Added an answer on June 6, 2026 at 7:03 pm

    Make the color have 80% in the alpha channel. For example, for red use #CCFF0000:

    <TextView
       ...
       android:background="#CCFF0000" />
    

    In the example, CC is the hexadecimal number for 255 * 0.8 = 204. Note that the first two hexadecimal digits are for the alpha channel. The format is #AARRGGBB, where AA is the alpha channel, RR is the red channel, GG is the green channel and BB is the blue channel.

    I’m assuming that 20% transparent means 80% opaque. If you meant the other way, instead of CC use 33 which is the hexadecimal for 255 * 0.2 = 51.

    In order to calculate the proper value for an alpha transparency value you can follow this procedure:

    1. Given a transparency percentage, for example 20%, you know the opaque percentage value is 80% (this is 100-20=80)
    2. The range for the alpha channel is 8 bits (2^8=256), meaning the range goes from 0 to 255.
    3. Project the opaque percentage into the alpha range, that is, multiply the range (255) by the percentage. In this example 255 * 0.8 = 204. Round to the nearest integer if needed.
    4. Convert the value obtained in 3., which is in base 10, to hexadecimal (base 16). You can use Google for this or any calculator. Using Google, type “204 to hexa” and it will give you the hexadecimal value. In this case it is 0xCC.
    5. Prepend the value obtained in 4. to the desired color. For example, for red, which is FF0000, you will have CCFF0000.

    You can take a look at the Android documentation for colors.

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

Sidebar

Related Questions

Is there any way to make the background of the google charts transparent. Google
Simply, how to make a TextView transparent? (Not full transparency) I searched the docs
<FrameLayout android:layout_width=fill_parent android:layout_height=fill_parent android:background=@color/white > <RelativeLayout android:layout_width=fill_parent android:layout_height=fill_parent > <TextView android:id=@+id/summary android:text=Summary android:textSize=25px android:textColor=@color/black
I want to make the background of a textview widget black and the foreground
I am trying to make programatically a PaintDrawable background for a TextView so it
I need to change the background color of a TextView. the font color using
Is there a way to make EditText behaviors like TextView in Android (XML is
How can I make a Text View's background transparent in Interface Builder?
Is there a way to make my textview wrap around other views? For example
How do I make a background image fit the view but keep its aspect

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.