美文网首页Android之界面
RecyclerView 的item显示的间距过大(item占满

RecyclerView 的item显示的间距过大(item占满

作者: 油松咸鱼崽 | 来源:发表于2018-05-30 12:17 被阅读397次

    先上我的不符合预期的界面图:
    图一为界面一刚刚打开,显示item信息 name:smartDisplay_n

    first.png

    图二为向下滑动一定距离,item显示item的操作,显示item的name:OxiEasy W60


    second.png

    图三为完全显示name:OxiEasy W60的item


    third.png

    这是看回我item的布局文件,发现
    <?xml version = "1.0" encoding = "UTF-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    。。。
    </LinearLayout>
    item的根部局的高度属性是 match_parent,
    哇~~心态炸了
    这里就是不能达到预期效果图的原因所在,把属性换为 wrap_content。看图:

    fourpng.png

    emm,记录一下~~谢谢参考的链接

    参考 https://blog.csdn.net/wenghaoduan/article/details/78512435

    相关文章

      网友评论

        本文标题:RecyclerView 的item显示的间距过大(item占满

        本文链接:https://www.haomeiwen.com/subject/chutsftx.html