How do I decrease the alpha ONLY of the parent component of the layout.xml?

0

Hi, I have something like the following

The View containing the EditText is a CardView, to which I try to lower the opacity without affecting the other elements, but I only see the alpha property and it affects all the internal components of the Viewas like this:

Is there any way to lower the opacity without decreasing that of the child components?

    
asked by Parzival 20.11.2017 в 19:27
source

1 answer

1

You could use a Framelayout, then in an imageview that would be the background and your login form.

At the imageview you put transparency and thus it does not affect your login form :)

Something like this:

<FrameLayout>
    <ImageView
        android:background="@drawable/background" 
        android:alpha="0.3" />
    <LinearLayout>
        <Button />
        <Button />
    </LinearLayout>     
</FrameLayout>
    
answered by 20.11.2017 в 19:31