Skip to content

Text with gradient in Android

SEONGJU KIM edited this page May 16, 2021 · 1 revision
TextView secondTextView = new TextView(this);
Shader textShader=new LinearGradient(0, 0, 0, 20,
            new int[]{Color.GREEN,Color.BLUE},
            new float[]{0, 1}, TileMode.CLAMP);
secondTextView.getPaint().setShader(textShader);
Clone this wiki locally