微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

recycleview布局混乱

使用recycleview的时候,item里面的布局在预览界面没问题,但是实际运行结果很糟糕,我用的是linearlayoutmanager,原来布局中最外围的linearlayout不能只包含一个子布局

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

<内容>

</LinearLayout>
</LinearLayout>

改成

<LinearLayout

xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical">

<内容>

</LinearLayout>

huangjunjie1991 发布了24 篇原创文章 · 获赞 12 · 访问量 3万+ 私信 关注

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐