Problems with transparency in android studio

Asked

Viewed 40 times

0

Hello, I have an APP in android studio that has a Linearlayout with transparency but the children of this Linearlayout are also inheriting transparency, and I did not want, as I do for only the Linearlayout have transparency?

Code:

<?xml version="1.0" encoding="utf-8"?>
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:background="@drawable/fundo"
            android:layout_height="match_parent"
            tools:context=".MainActivity">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">


                <ImageView
                    android:id="@+id/imageView"
                    android:layout_width="match_parent"
                    android:layout_height="71dp"
                    android:layout_marginTop="30sp"
                    app:srcCompat="@drawable/ic_logo" />

                <TextView
                    android:id="@+id/textView2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/wellcome"
                    android:layout_marginTop="20sp"
                    android:textAlignment="center"
                    android:textColor="#FFF"
                    android:textSize="30sp" />

                <LinearLayout
                    android:layout_width="392dp"
                    android:layout_height="550dp"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="5sp"
                    android:alpha="0.5"
                    android:background="@drawable/ll"
                    android:orientation="vertical">

                    <EditText
                        android:id="@+id/editText2"
                        android:layout_width="370dp"
                        android:layout_height="60dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginTop="10sp"
                        android:background="@drawable/edittext"
                        android:ems="10"
                        android:inputType="textPersonName"
                        android:paddingLeft="10dp"
                        android:textColorHint="#FFF"
                        android:hint="E-mail ou Telemovel"
                        android:textColor="#fff" />

                    <EditText
                        android:id="@+id/editText3"
                        android:layout_width="370dp"
                        android:layout_height="60dp"
                        android:paddingLeft="10dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_marginTop="12sp"
                        android:background="@drawable/edittext"
                        android:ems="10"
                        android:inputType="textPassword"
                        android:hint="Password"
                        android:textColorHint="#FFF"
                        android:textColor="#fff" />

                    <Button
                        android:id="@+id/button"
                        android:layout_width="370dp"
                        android:layout_marginTop="10sp"
                        android:background="#FA3D3D"
                        android:textColor="#fff"
                        android:layout_height="58dp"
                        android:layout_gravity="center_horizontal"
                        android:text="Entrar" />
                </LinearLayout>
            </LinearLayout>

        </RelativeLayout>
  • Have you tried individually adjusting the attribute android:background in each LinearLayout?

1 answer

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.