Android 包装布局在前面与阿尔法
在我的应用程序中,我试图在一个布局中的所有视图上实现一个不可链接的包装器布局,以禁用它们,例如,到目前为止我所做的预览版本 XML:UPDATEDAndroid 包装布局在前面与阿尔法,android,layout,Android,Layout,在我的应用程序中,我试图在一个布局中的所有视图上实现一个不可链接的包装器布局,以禁用它们,例如,到目前为止我所做的预览版本 XML:UPDATED <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.a
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_height="match_parent"
>
<ProgressBar
android:indeterminate="true"
android:theme="@style/CircularProgress"
android:id="@+id/car_progress"
style="?android:attr/progressBarStyle"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_centerInParent="true"
android:visibility="gone"
/>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/car_progress"
android:id="@+id/nested_scroll"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/mega_wrapper"
android:layout_alignParentStart="true">
<!-- all previewable views -->
<!-- Wrapper Layout with alpha background-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/alphaWhite"
android:clickable="false"
>
</LinearLayout>
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
但它不能正常工作。因为我无法在所有视图上看到alpha包装器。像这样更改布局顺序
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ProgressBar
android:id="@+id/car_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyle"
/>
<android.support.v4.widget.NestedScrollView
android:id="@+id/nested_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/car_progress"
>
<RelativeLayout
android:id="@+id/mega_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<!-- all previewable views -->
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
<!-- Wrapper Layout with alpha background-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#33FF0000"
android:clickable="false"
/>
</RelativeLayout>
在alpha背景的包装布局中使用mega_包装(相对布局)。在scrollview中,只有一个父布局允许我检查。不幸的是,它不起作用,因为我已经更新了xmlits,但在所有视图之上添加包装布局对我来说仍然不起作用。然而,如果我在dps中将字母白色背景的布局高度指定为某个值,它工作得很好,但它是静态类型的value@MehvishFaisal您想要包装布局
全屏还是只包装内容?什么是alphaWhite值?alphaWhite值是#33ffffff,即20%或我也尝试指定纯色,以检查所有视图是否符合该布局,但它不适合我。我希望它是全屏包装的整体嵌套布局,使它看起来像preview@MehvishFaisal我给你做了个测试。我认为你的布局设计是正确的。我认为问题是20%的白色看起来像white@MehvishFaisal如果希望下面的视图不可点击,则应将LinearLayout的属性android:clickable=“false”
更改为android:clickable=“true”