我有一个不显示特定布局的回收站视图。我知道布局是问题,因为我尝试了不同的布局,并且正在显示它们。我不会在控制台中发现错误的布局错误。RecyclerView不显示布局
这如下布局结构:
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:background="#000"
android:layout_height="match_parent">
<android.support.percent.PercentRelativeLayout 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:background="@color/border_color"
app:layout_heightPercent="30%">
</android.support.percent.PercentRelativeLayout>
</android.support.percent.PercentRelativeLayout>
我看到它呈现正常,但可能是有点问题的。我希望每个回收商的物品都有30%的高度,这就是我使用app:layout_heightPercent="30%"
的原因。如果我删除外部布局,则内部布局将占用所有空间。我怎样才能达到这个30%的高度,因为显然这是行不通的。
为什么选d你有两个PercentRelativeLayout?如果你这样做,什么都不会显示 – hehe
我在问题中解释了它。这不是我的整个布局。内部布局中有很多东西。我使用其中2个的唯一原因是因为如果我在预览时只使用了内部的一个,它不仅占用了所有空间的30% –