About 674,000 results
Open links in new tab
  1. android - How to set the text color of TextView in code ... - Stack ...

    Jan 5, 2011 · In order to set color of a TextView, TextView.setTextColor(R.color.YOURCOLOR) is not enough! It has to be used like this – TextView myText = (TextView) …

  2. android - How can I change the color of a part of a TextView?

    Apr 18, 2018 · If you want to change a part of the text to the color you want, just put your text instead of "Masoud" or "Siahkali" and enter the color you want in the "color" section. String text …

  3. How to Set the Text Color of TextView in Code? - GeeksforGeeks

    Jul 17, 2022 · In this article, we will learn about how to add two or more text colors in a single string of TextView of Android using Java/Kotlin. It is very easy to add multiple colors in a single …

  4. Change clickable TextView's color on focus and click?

    If you want to set stateful color from code, you need to pass in ColorStateList as an argument to setTextColor passing an int to the method results in setting the color to all the states. It also …

  5. How to change Text Color of TextView in Android? - Tutorial Kart

    Android TextView Text Color - To change the color of text in TextView, you can set the color in layout XML file using textColor attribute or change the color dynamically in Kotlin file using …

  6. How To Set Text Color And Background Color In Android

    This example will tell you how to set the android.widget.TextView text foreground color and background color in source code. For other android UI components, it is similar to change …

  7. How to Set the Text Color of a TextView Programmatically in Android

    Jun 6, 2024 · Learn how to programmatically set the text color of a TextView in Android. Understand the correct parameters for setTextColor () and avoid common pitfalls.

  8. android - Set Background Color for a textview - Stack Overflow

    Mar 30, 2018 · You are setting a drawable file to your Textview. android:background="@drawable/rounded_corner" In your java code I think you need to set …

  9. How to set the text color of TextView in code? - matheusmello.io

    By default, in XML, you can easily set the text color of a TextView using the textColor attribute. For example, android:textColor="#FF0000" would set the text color to red. But how do we …

  10. Creating a Dynamic Color-Changing TextView in Android Using a Color

    Feb 18, 2024 · A TextView in Android that infinitely changes color to create a rainbow kind of effect. The first strategy for this was to have a long list of colors in the color resource file. This...

  11. Some results have been removed
Refresh