如何在图像视图上使布局透明
答
// "image transparent programmatically android"
float alpha_first = 0.2f;
float alpha_second = 1.0f;
AlphaAnimation alphadp = new AlphaAnimation(alpha_second, alpha_first);
switch (v.getId()) {
case R.id.disable_deactivate_pic:
ImageButton disable_button =(ImageButton)findViewById(R.id.disable_deactivate_pic);
if (!flag) {
disable_button.setImageResource(R.drawable.enable_active);
linearLayout_for_picture = (LinearLayout) findViewById(R.id.linearlayout_imageView_pic);
alphadp.setFillAfter(true);
linearLayout_for_picture.startAnimation(alphadp);
flag=true;
}
else {
disable_button.setImageResource(R.drawable.disable_active);
alphadp.setFillAfter(false);
linearLayout_for_picture.startAnimation(alphadp);
flag=false;
}
break;
[1]: http://i.stack.imgur.com/A0V2V.png
你可以添加一些代码,请? –
尝试android:background =“#00000000” – Samuel
我给了一个布局(垂直),其中有一个文本视图..以及图像视图 。我希望文本视图在图像视图上显示为透明。你能给我一个支持这个问题的例子吗? – bharath