1
我面临这个奇怪的问题,其中我的Recycleview是高度的wrap_content,但它占用了屏幕的全部高度,而我的内容仅占用了一半的屏幕空间。 我读到这是一个bug,它在23.2.1中修复。我使用: -Recycleview wrap_content问题
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
在XML另外,我还没有添加任何具体的: -
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/margin_10"
android:layout_marginLeft="@dimen/margin_20"
android:layout_marginRight="@dimen/margin_20"
android:layout_marginTop="@dimen/margin_10"
android:layout_weight="1">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycleview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF0000" />
</android.support.v4.widget.SwipeRefreshLayout>
<include layout="@layout/layout_circular_progress_bar" />
</FrameLayout>
正如你可以从图片看我的内容只有一半,圆形的白色部分和下面的红色部分是额外的。如何删除这个?
第一点工作。设置重量为1的线性布局 –