Changing text color of list view in android

后端 未结 3 1353
挽巷
挽巷 2021-01-13 23:50

I am trying to change the text color of a listview in Android. Can anyone please give me a heads up on how it\'s done?

3条回答
  •  天命终不由人
    2021-01-14 00:14

    You can use themes to set the styles for your TextViews. From the Android dev site.

    
    
        
    
    

    Then to use it:

    
    

    Edit - based on comment

    You asked about multiple color in the same TextView: Your best bet is to use html. Which you set in a TextView for example:

    myTextView.setText(Html.fromHtml("

    " + someText + "

    " + someOtherText + "

    "));

提交回复
热议问题