有人可以帮忙吗?我正在尝试在RecyclerView
中实现带有动态内容的菜单。 SwipeRefreshLayout
正常工作,但<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:layout_width="0dp"
android:layout_height="1000dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"/>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.constraint.ConstraintLayout>
不能正常工作。
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
更新:
<android.support.design.widget.NavigationView
android:id="@+id/home_navigationview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="false"
app:headerLayout="@layout/layout_home_header"/>
在NavigationView的app:headerLayout中设置布局
$ sudo pip3 install vtk
Collecting vtk
Could not find a version that satisfies the requirement vtk (from versions: )
No matching distribution found for vtk
答案 0 :(得分:0)
<android.support.v4.widget.SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v7.widget.RecyclerView
.../>
</android.support.v4.widget.SwipeRefreshLayout>
ConstraintLayout
。由于您没有孩子了,请直接使用SwipeRefreshLayout
match_parent
建议:
如果您不熟悉Android,请从LinearLayout
,RelativeLayout
和FrameLayout
开始学习。这样会清除您的布局。