问题: 我有一个RecyclerView
和一个Toolbar
在一个CoordinatorLayout
中。RecyclerView
在Toolbar
下面,但它不应该。
问题: 我如何让RecyclerView
和Toolbar
有一个边框?
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar">
<include
android:id="@+id/toolbar_main"
layout="@layout/toolbar"></include>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/maschinelistcontainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.design.widget.CoordinatorLayout>
maschine_fragment.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:scrollbars="vertical" />
</LinearLayout>
app:layout_behavior="@string/appbar_scrolling_view_behavior"
添加到你的FrameLayout
中。 - V-rund Puro-hit