1

I've got a view i'd like to set the opacity of. Eclipse tells me i can use any value between 0 and 1 but 0.5 for instance wont work since it has the data type double.

v.setAlpha(1);

The data type needs to be float, but im am not sure what that means. How would i set the opacity to 50% for example?

Thanks.

4

1 回答 1

3

50% 是

v.setAlpha(0.5f);

因为 1% 只是 1/100。

于 2013-04-29T19:27:47.287 回答