这就是我想要建立的。 圆形部分将在布局之外,其余部分将是透明的默认动作
直到现在我已经实现了。 圆形部分正在退出,但父布局没有采取我需要的任何透明度。我试图给出透明的颜色,但它没有采取。我需要的是第二张图片中的蓝色部分,我需要它就像对话框出现时一样透明。但是它采用了父布局的颜色。这是我的布局xml:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:id="@+id/bottom_layout"
android:background="@color/colorRed"
>enter code here
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/_25sdp"
android:background="@color/colorWhite"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginTop="@dimen/_45sdp"
android:orientation="vertical">
<TextView
android:id="@+id/firstName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_7sdp"
android:backgroundTint="@color/colorLightGrayText"
android:gravity="center"
android:hint="@string/settings"
android:inputType="text"
android:singleLine="true"
android:textColor="@color/colorBlackText"
android:textColorHint="@color/colorBlackText"
android:textCursorDrawable="@drawable/color_cursor"
android:textSize="@dimen/_18sdp"
android:textStyle="bold"/>
<CustomTextView
android:id="@+id/lastName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_10sdp"
android:backgroundTint="@color/colorLightGrayText"
android:gravity="center"
android:hint="@string/login_to_access_settings"
android:inputType="text"
android:singleLine="true"
android:textColor="@color/colorGray"
android:textColorHint="@color/colorGray"
android:textCursorDrawable="@drawable/color_cursor"
android:textSize="@dimen/_15sdp" />
<android.support.design.widget.TextInputLayout
android:id="@+id/userName_Wrapper"
android:layout_width="match_parent"
android:layout_height="@dimen/_50sdp"
android:layout_marginTop="@dimen/_25sdp"
android:textColorHint="@color/colorLightGrayText"
android:theme="@style/TextLabelGray"
app:errorTextAppearance="@style/error_appearance_gray">
<CustomEditText
android:id="@+id/userName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/colorLightGrayText"
android:hint="Username"
android:inputType="text"
android:singleLine="true"
android:textColor="@color/colorGray"
android:textColorHint="@color/colorWhite"
android:textCursorDrawable="@drawable/color_cursor"
android:textSize="@dimen/_14sdp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/password_wrapper"
android:layout_width="match_parent"
android:layout_height="@dimen/_50sdp"
android:textColorHint="@color/colorLightGrayText"
android:theme="@style/TextLabelGray"
app:errorTextAppearance="@style/error_appearance_gray">
<CustomEditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/colorLightGrayText"
android:hint="@string/password"
android:inputType="textPassword"
android:singleLine="true"
android:textColor="@color/colorGray"
android:textColorHint="@color/colorWhite"
android:textCursorDrawable="@drawable/color_cursor"
android:textSize="@dimen/_14sdp" />
</android.support.design.widget.TextInputLayout>
<CustomTextView
android:id="@+id/logInSettingWrapper"
android:layout_width="match_parent"
android:layout_height="@dimen/_50sdp"
android:layout_marginBottom="@dimen/_20sdp"
android:layout_marginTop="@dimen/_10sdp"
android:background="@drawable/bg_gray_rounded_rect"
android:gravity="center"
android:padding="@dimen/_10sdp"
android:text="@string/login_to_settings"
android:textAllCaps="true"
android:textColor="@color/colorWhite"
android:textSize="@dimen/_16sdp"
android:textStyle="bold" />
<ImageView
android:id="@+id/btn_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="@dimen/_15sdp"
android:layout_marginBottom="@dimen/_15sdp"
android:src="@drawable/cross_pg_bottom_gray" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
android:layout_marginBottom="-50dp"
android:background="@drawable/bg_bottom_sheet">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/nav_settings" />
</FrameLayout>
</FrameLayout>
</LinearLayout>
答案 0 :(得分:0)
你只需要透明你的蓝色布局。我希望它可以帮助你,除非你更新你的xml文件。