Wednesday, August 17, 2011

[android-developers] Re: Just to nag about inconsistency in Android api and lack of enough documentation

> Guess what are the differences between TextView.setText(int) and
> TextView.setTextColor(int)
The name of the arguments are different (resId vs. color). If all int
arguments in the api were resource IDs that would really suck.

On 17 Aug, 11:40, Reza Mohammadi <remohamm...@gmail.com> wrote:
> Guess what are the differences between TextView.setText(int) and
> TextView.setTextColor(int)
>
> Answer:
> the first int should be a resource id, but the second one should NOT
> be a resource id.
>
> So if you are calling setTextColor(R.color.red) and you see grey, you
> are not necessarily colorblind. Use setTextColor(0xffff0000) instead.

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

No comments:

Post a Comment