ImageView setalpha not working

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

ImageView setalpha not working

Postby BGH » Sat Sep 12, 2009 5:18 am

I would have thought this would be quite simple but for some reason it just isnt working. All I want to do is change the transparency of an ImageView.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. ivLeagueBall = new ImageView(this);
  2.  
  3. ivLeagueBall.setBackgroundResource(R.drawable.league_ball1);
  4.  
  5. layout.addView(ivLeagueBall, lp);
  6.  
  7. ivLeagueBall.setAlpha(10);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


But for some reason the alpha isnt changing. Any ideas?
User avatar
BGH
Junior Developer
Junior Developer
 
Posts: 23
Joined: Thu Feb 12, 2009 3:51 am
Location: Melbourne, Australia

Top

Postby BGH » Sat Sep 12, 2009 7:10 am

Stupid me. My girlfriend came round and as I was talking her through it to explain to her why I was so frustrated I realised I was using setBackgroundResource instead of setImageResource.

Works now :)
User avatar
BGH
Junior Developer
Junior Developer
 
Posts: 23
Joined: Thu Feb 12, 2009 3:51 am
Location: Melbourne, Australia

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests