【发布时间】:2018-07-22 13:35:16
【问题描述】:
我正在尝试禁用滚动视图并显示主页中的所有内容,但是直到没有运气滚动才显示所有内容。我已经尝试了有关此的所有问题,但仍然没有运气。如果有人可以帮助我,我将不胜感激。谢谢:)
这里是fragment_home.xml..
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg">
<ProgressBar
android:id="@+id/progressBar"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone" />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/ContainerSlider"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_latest"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_featured"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
【问题讨论】:
-
禁用滚动视图是什么意思?另外,为什么需要两个 recyclerview?
-
意味着如果启用滚动视图,我想显示 fragment_home 中的所有内容,然后我认为内容不显示。
-
你不需要带有 recyclerview 的滚动视图。您的布局应该可以使用单个回收器视图
-
你能帮我让代码在没有滚动视图的情况下工作吗?
-
是的,如果你能与我分享一个关于你想要实现的粗略设计/草图
标签: android android-layout android-fragments android-xml