Here is my code
In xml file I have defined
<TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/title"
                android:textColor="@color/title_color"
                />

And in .java, I am specifying,

title = (TextView) convertView.findViewById(R.id.title);
title.setText(bookDetails.title);
title.setTextColor(0xffff00ff);

And, the code is setting the text color to some kind of purple. It is
working.
-Hegde
On Feb 16, 2:12 am, Oldarney <[email protected]> wrote:
> The following do not work:
>
> myDate.setTextColor(0xFFFF00FF);
> myDate.setTextColor(Color.argb(250,250,0,250));
>
> The reason being is that it wants a reference to the XML object.
> Search after search I find that no one in the androidverse has been
> able to programatically set a custom color.
>
> Can anyone get the TextView to change color without pulling the color
> from an XML file? given that there are about 16million possible
> colors, taking that approach seems unreasonable for my purposes. I
> need to give the user the ability to use sliders to precision pick the
> color of the text in the TextView.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to