我在RelativeLayout
内部有一个父布局ScrollView
,其中包含多个子布局和RelativeLayout
末尾的子布局(即preview_wrapper),用{{1}填充它} match_parent
并包含带有Alpha颜色的背景,其LayoutParam
和clickable
设置为true,以便父布局中的任何视图都不可点击。但它不适合我,我无法看到最后一个孩子填充父布局带到前面。然而,当我删除focusable
它的工作完美..但我需要将它带到ScrollView
内,因为我在ScrollView外部ScrollView
我无法滚动布局。
结构:
preview_wrapper
XML:
<ScrollView>
<RelativeLayout>
<LinearLayout>
</LinearLayout>
<!-- the layout I want to bring in front of above linear layout and cover its parent -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/alpha_white"
android:clickable="true"
android:focusable="true"
android:id="@+id/preview_wrapper"
></RelativeLayout>
</RelativeLayout>
</ScrollView>
答案 0 :(得分:1)
然后将RelativeLayout
变为FrameLayout
并重新排列子布局,如下所示
<ScrollView>
<FrameLayout>
<!-- the layout I want to bring in front of above linear layout and cover its parent -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/alpha_white"
android:clickable="true"
android:focusable="true"
android:id="@+id/preview_wrapper"
></RelativeLayout>
<LinearLayout>
</LinearLayout>
</FrameLayout>
</ScrollView>