xml - TextView with multiple color gradient effect in android -


how can create textview below

enter image description here

i tried few answers in stackoverflow including this.but none of them suitable issue

i tried code .but gradient effect vertically. need horizontal.

shader textshader=new lineargradient(0, 0, 0, 60,             new int[]{color.parsecolor("#87d8b0"),color.parsecolor("#edb030")},             new float[]{0, 1}, shader.tilemode.clamp);     textview.getpaint().setshader(textshader); 

and tried this

  textview.getpaint().setshader(new lineargradient(0,0,0,textview.getlineheight(),color.parsecolor("#87d8b0"), color.parsecolor("#edb030"), shader.tilemode.repeat)); 

i want more 2 colors gradient effect. please help


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -