我在我的片段中使用了NestedScrollView。在我的xml文件中,它位于RelativeLayout中,但它没有覆盖整个屏幕高度。
以下是我的代码 -
提前致谢。
以下是我的代码 -
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:fitsSystemWindows="true"
android:background="@color/black"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:background="@color/red_error_color"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
当运行代码时,只能看到黑色背景,而不能看到红色,因为我的子视图背景是红色。提前致谢。