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

  • Home
  • SEARCH
  • 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 8734751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:54:29+00:00 2026-06-13T09:54:29+00:00

i search from while for giving gradient to textView in android.but not getting proper

  • 0

i search from while for giving gradient to textView in android.but not getting proper solution any where.

i have the screen like thisthe text in the image is actually having the gradient

if i put the images as text, but i have many textview which having gradient,then application may be large in size.
so if anybody know the solution please post it.
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-06-13T09:54:30+00:00Added an answer on June 13, 2026 at 9:54 am

    Here It goes,

    int[] color = {Color.DKGRAY,Color.CYAN};
            float[] position = {0, 1};
            TileMode tile_mode = TileMode.REPEAT;
            LinearGradient lin_grad = new LinearGradient(0, 0, 0, 35,color,position, tile_mode);
            Shader shader_gradient = lin_grad;
            your_text_view.getPaint().setShader(shader_gradient);
    

    Edited:

    Hi @android developer,

    If you want to do some vertical or any gradients to the view,

    Please use,

    RadialGradient instead of LinearGradient.

    Only thing is you have to adjust,

    x coordinate of the center of the radius.
    y coordinate of the center of the radius.
    
    and also,
    
    radius value of the view.
    

    and use Tile Mode as Mirror instead of Repeat.

    I have sample but it may not exact of what you want,

    TileMode tile_mode = TileMode.MIRROR or TileMode.REPEAT;
            RadialGradient rad_grad = new RadialGradient(0, 3, 5, Color.BLUE,Color.RED,tile_mode, tile_mode);
            Shader shader_gradient = rad_grad;
            your_text_view.getPaint().setShader(shader_gradient);
    

    And you can use SweepGradient also instead of LinearGradient.

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

Sidebar

Related Questions

While trying to search with id sorting (and paginating) im getting from the log:
Not sure why but I am not getting anything back from the json call.
I have ported a search from Coldfusion into a MySQL stored procedure. The actual
I have a scenario where I need to search from many binary files (using
I have decided to change a search from using LIKE '%' + @searchTerm +
I have a PHP and jQuery script that creates search result suggestions from a
I am trying to get my search values from the android browser with following
While running a best-first search from M Tim Jones' Artificial Intelligence: A Systems Approach
i have the following code for search from database show return result to the
We are currently replacing our product search from mysql to a SOLR backend. Our

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.