【发布时间】:2018-11-12 12:07:08
【问题描述】:
在我的 android 应用程序中,页面顶部和下方有一个幻灯片,有一个回收器视图,我的问题是如何在回收器视图上方添加幻灯片,以使幻灯片可以使用回收器视图滚动。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="fill_parent"
android:layout_height="match_parent"
android:background="@drawable/pattern"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/app_bar_main">
<ImageView
android:layout_width="match_parent"
android:layout_height="200dp"
android:src="@drawable/line" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/main_swipe"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/rc"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
【问题讨论】:
-
分享图片你需要什么样的UI?
-
将嵌套滚动视图作为父视图,并为回收站视图设置嵌套滚动 false
-
我也会选择@Redman 的解决方案
-
@Redman 不工作
-
它肯定会起作用,发布你做了什么作为问题的编辑
标签: android xml android-recyclerview