The method setAlpha(int) is undefined for the type View
so i am trying to programmatically change the alpha value of a view based on the position of a seekbar. this is what i originally had: view.setAlpha(x);
with that i get this error The method setAlpha(int) is undefined for the type View
. so i looked up on the interwebs and stackoverflow and saw a few posts that looked promising. so next开发者_运维百科 i tried checkBoxTest.this.view.setAlpha(1);
where checkBoxTest is my activity. and got the same result. on both occasions it asks me if i want to either change to onSetAlpha()
or cast the receiver. neither solution solves the problem. According to the docs (Android Developers Reference) the method setAlpha()
is used to set the transparency of a view. so my question: has anyone ever gotten setAlpha() to work? and if so how would i go about implementing it? (ps i would prefer a solution that uses setAlpha as opposed to overriding onSetAlpha(), but if that is the only way to make it work then i'll use it)
View.setAlpha()
is available since API level 11 (docs). Perhaps you are building against lower API level?
精彩评论