How to make a linearLayout partially transparent in android?

前端 未结 7 1911
刺人心
刺人心 2021-01-31 04:01

I have a RelativeLayout containing 2 LinearLayouts one of them is partially covering the other. I want to make the part of the LinearLayout

7条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 04:53

    Make your LinearLayout Background Transparent :

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

    and for making your Layout Partially Transparent maybe this Link Helps you : How to create View partially invisible

    Edit: if you have an Image as Background of your layout so i think you can set alpha for your LinearLayout and control it from code without changing your background, to Transparent your Layout with Background Image :

    android:alpha=""
    
    alpha property of the view, as a value between 0 (completely 
    transparent) and 1 (completely opaque)
    

提交回复
热议问题