2011-08-29 97 views
0

如何在Android的图像视图上显示透明布局?如何在图像视图上使布局透明

我在图像视图上有一个线性布局,都在布局中。我希望线性布局在图像视图上是透明的。我们能做到吗?

+0

你可以添加一些代码,请? –

+1

尝试android:background =“#00000000” – Samuel

+0

我给了一个布局(垂直),其中有一个文本视图..以及图像视图 。我希望文本视图在图像视图上显示为透明。你能给我一个支持这个问题的例子吗? – bharath

回答

3

使用该属性:

android:background="@android:color/transparent" 
+0

ya其工作..谢谢 – bharath

+0

我已经改变它到android:background =#80000000“它的工作..部分透明。 – bharath

+0

是的,它工作正常。如果你把80之前你的颜色它将是透明的。信息。](http://developer.android.com/guide/topics/resources/more-resources.html#Color) – kameny

0
// "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