在现有布局上包括布局并滚动

我在books.xml文件中有一个recylerview,其中我将一些常规的书本记录显示为列表。我正在尝试在books.xml文件中包含activity_main.xml文件,以在主窗口中显示书籍记录。我需要将此记录显示为主要活动窗口上的覆盖窗口,因为用户可以垂直滚动它们以查看整个记录。如下图所示

在现有布局上包括布局并滚动

这是我当前的activity_main.xml文件。如何获得相同的结果

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/activity_main"
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:layout_height="match_parent"
android:background="@color/white"
tools:context="com.trioangle.goferdriver.Mainactivity"
android:keepScreenOn="true">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:background="@color/colorblock"
    android:id="@+id/relativeLayout2">
    <ImageView
        android:visibility="gone"
        android:id="@+id/homelist"
        android:layout_width="50dp"
        android:layout_height="wrap_content"
        android:padding="12dp"
        android:layout_centerVertical="true"
        android:src="@drawable/list"
        android:tint="@color/white"/>
    <View
        android:visibility="gone"
        android:id="@+id/view"
        android:layout_width="1dp"
        android:layout_height="match_parent"
        android:layout_toRightOf="@+id/homelist"
        android:background="@color/button_material_light"
        android:layout_marginLeft="5dp"
        android:layout_marginBottom="5dp"
        android:layout_marginTop="5dp"/>
    <com.trioangle.goferdriver.custompalette.FontTextView
        android:id="@+id/txt_driverstatus"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/offline"
        android:paddingLeft="20dp"
        android:layout_centerVertical="true"
        android:textSize="18sp"
        android:textColor="@color/white"
        app:font="@string/font_UberMedium"
        android:layout_toRightOf="@+id/homelist"
        />

    <android.support.v7.widget.SwitchCompat
        style="@style/SwitchCompatStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/switch_driverstatus"
        android:layout_alignParentRight="true"
        android:layout_marginRight="20dp"
        android:checked="false"
        android:layout_centerVertical="true"/>

    <com.trioangle.goferdriver.custompalette.FontTextView
        android:visibility="gone"
        android:background="@color/ub__red"
        android:id="@+id/txt_checkdriverstatus"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/checkstatus"
        android:layout_alignParentRight="true"
        android:layout_marginRight="20dp"
        android:layout_centerVertical="true"
        android:textSize="18sp"
        android:padding="5dp"
        android:textColor="@color/white"
        app:font="@string/font_UberMedium"
        />
</RelativeLayout>

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/relativeLayout2">

    <TextView
        android:id="@+id/iv_line"
        android:layout_width="50dp"
        android:layout_height="5dp"
        android:background="#ffffff"/>

</RelativeLayout>

<FrameLayout
    android:id="@+id/frame_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/navigation"
    android:layout_below="@+id/relativeLayout2">
</FrameLayout>

<android.support.design.widget.BottomNavigationView
    android:paddingTop="5dp"
    android:paddingBottom="5dp"
    android:layout_centerVertical="true"
    android:id="@+id/navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@color/colorblock"
    app:itemIconTint="@color/nav_item_state_list"
    app:itemTextColor="@color/nav_item_state_list"
    app:menu="@menu/bottom_nav_items"
    android:animateLayoutChanges="false"
    android:splitMotionEvents="false"/>

jksaghefi 回答:在现有布局上包括布局并滚动

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3028291.html

大家都在问