Sunday, 11 August 2013

Using multiple text colors in Android's textview

I had faced on issue in my past project. How to set multiple colors in single textview ? For that I have solve it using following way.

    productprice.setText(Html.fromHtml("Price" + ": "
                    + "<font color=\"#990000\">"

                    + cartList.get(position).ProductPrice + " " + "</font>"));

productprice is TextView, set   android:textColor as default color for Textview.

Hope it helps you also.

No comments:

Post a Comment