seatAdapter.notifyItemChanged(position);

原因分析:是因为TextView高度为wrap_content,如果改成match_parent,并且父布局高度写死,那么就OK,记录一下,方便以后碰到此问题,能尽快处理,
还有如果指定Item宽度为 match_parent 但是条目实际显示在屏幕上并不是match_parent,那么我的修改办法是加一条分割线,该分割线宽度为match_parent,如果不想要分割线,可以让分割线进行隐藏。

上面这个原因没有从源码的角度分析,本人能力也不够,希望以后可以从源码角度分析原因。

修改之前的布局文件

<?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="wrap_content"android:paddingTop="5dp"android:orientation="vertical"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"android:id="@+id/llSeatContainer"android:orientation="horizontal"><TextViewandroid:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:id="@+id/tvSeatId"android:text="座位1"android:gravity="center"android:textColor="@color/black"android:textSize="14sp" /><ImageViewandroid:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:id="@+id/ivIsSeatSelect"android:layout_marginTop="3dp"android:src="@drawable/shap_seat_no_selected" /><TextViewandroid:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:gravity="center"android:text="李三一"android:id="@+id/tvSeatUserName"android:textColor="@color/black"android:textSize="14sp" /><TextViewandroid:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:gravity="center"android:text="总经理"android:id="@+id/tvSeatUserPosition"android:textColor="@color/black"android:textSize="14sp" /><TextViewandroid:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="2"android:gravity="center"android:text="18291777145"android:id="@+id/tvSeatUserPhone"android:textColor="@color/black"android:textSize="14sp" /></LinearLayout><Viewandroid:layout_width="match_parent"android:layout_height="1px"android:layout_marginTop="10dp"android:background="@color/divide_line" />
</LinearLayout>

修改之后的布局文件

<?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="wrap_content"android:orientation="vertical"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="30dp"android:id="@+id/llSeatContainer"android:orientation="horizontal"><TextViewandroid:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"android:id="@+id/tvSeatId"android:text="座位1"android:gravity="center"android:textColor="@color/black"android:textSize="14sp" /><ImageViewandroid:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:id="@+id/ivIsSeatSelect"android:layout_marginTop="3dp"android:src="@drawable/shap_seat_no_selected" /><TextViewandroid:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"android:gravity="center"android:text="李三一"android:id="@+id/tvSeatUserName"android:textColor="@color/black"android:textSize="14sp" /><TextViewandroid:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="1"android:gravity="center"android:text="总经理"android:id="@+id/tvSeatUserPosition"android:textColor="@color/black"android:textSize="14sp" /><TextViewandroid:layout_width="0dp"android:layout_height="match_parent"android:layout_weight="2"android:gravity="center"android:text="18291777145"android:id="@+id/tvSeatUserPhone"android:textColor="@color/black"android:textSize="14sp" /></LinearLayout><Viewandroid:layout_width="match_parent"android:layout_height="1px"android:layout_marginTop="10dp"android:background="@color/divide_line" />
</LinearLayout>

RecyclerView 的 adapter.notifyItemChanged(position) 导致该条目布局放生改变相关推荐

  1. 9.kotlin安卓实践课程-用kotlin写第一个fragment的recyclerView的adapter具体实现

    简介 主要会通过安卓实战来讲解kotlin语法和实际应用,本教程设及知识点包括框架模式mvp+mvvm, Databinding(数据绑定框架),Dagger2(依赖注入框架),DeepLink(页面 ...

  2. ListView和RecyclerView的Adapter封装

    原文链接 Android 快速开发系列 打造万能的ListView GridView 适配器 为RecyclerView打造通用Adapter 让RecyclerView更加好用 Android 优雅 ...

  3. RecyclerView中adapter列表里有EditText输入框问题(使用不复用方法解决)

    RecyclerView中adapter列表里有EditText输入框问题(使用不复用方法解决) 参考文章: (1)RecyclerView中adapter列表里有EditText输入框问题(使用不复 ...

  4. 微信设置字体变大后导致页面样式布局全乱

    转载: 微信放大字体导致页面样式布局全乱 - 男孩亮亮 - 博客园微信webview内置了调整字体大小的功能,用户可以根据实际情况进行调节.但是这也会导致字体大小改变以后,出现页面布局错乱的情况. 1 ...

  5. 关于Android Fragment、RecyclerView、Adapter、Holder

    (作为一个初学者对于Android 控件的学习与整理,前段时间也一直没太搞明白这四个的关联,就只知道网上拷贝代码来修改,今天整理并记录一下,内容简单并不深入,欢迎各位大佬补充) FrameLayout ...

  6. Android RecycleView切换条目布局visibility导致列表滑动

    在项目开发过程遇到一个问题,切换布局中某个子view的visibility为gone后,RecyclerView 自己莫名其妙的滚动了一点.通过网上查找发现,这是RecyclerView 抢占焦点导致 ...

  7. 【RecyclerView】 一、RecyclerView 最基本用法 ( 添加支持库 | 设置布局文件 | 自定义适配器 )

    文章目录 一.添加支持库 二.布局文件中使用 RecyclerView 三.自定义适配器 四.RecyclerView 设置流程 五.RecyclerView 完整 Java 代码示例 一.添加支持库 ...

  8. 用RecyclerView来实现苹果后台样式的卡片布局

    说到苹果的卡片布局我就想起当年我的挚爱--web OS系统了.在功能机转换到智能机的时代,Web oS系统是那样的出类拨萃,傲压群雄,只可惜现在流落到只能在电视上才能看到他的身影了.记得我的第一台智能 ...

  9. 【抬杠】在某些时候不希望用户缩小浏览器的宽度,因为咳咳~会导致你的布局混乱,那么这个代码就是帮助你如何限制浏览器宽度的

    方式1:简单纯粹,非Vue项目直接复制用完即走! /*限制浏览器宽度*/ @media screen and (max-width: 1200px) {html {overflow: hidden;} ...

最新文章

  1. 如何在 bash 中使用键值字典
  2. 盘点海外动力电池巨头 细数日韩锂电设备企业
  3. eclipse序列化生成serialVersionUID
  4. c#如何wmf图片转换成png图片_每日一学:如何将png图片转换为jpg图片
  5. 前端学习(3067):vue+element今日头条管理-element里面的image组件
  6. perl mysql dml_MySQL Connector执行SQL语句的三种方式
  7. [教程]Web自动化测试怎么做?Web网页测试全流程解析
  8. jedate插件的使用
  9. 服装制版师用软件代替手工_楚天都市报_多媒体报
  10. 灰色理论 光滑度处理 matlab,基于灰色理论的电子设备寿命预测研究
  11. 计算机网络自顶向下第七版第二章课后答案,《计算机网络·自顶向下方法》第七版 第二章 课后习题与问题 答案...
  12. html5 fa图标库,轻松学会在项目中使用fontawesome字体图标
  13. MT8173芯片资料,MT8173处理器参数介绍
  14. 如何一周之内摸清一个行业?
  15. 测绘界超强工具箱!CADCASS实用插件合集,各种功能应有尽有!断面、高程点、等高线、三角网、拓扑检查...
  16. 测试-APP端常见测试功能点
  17. 阿里云物联网平台最完全的使用教程
  18. 【晒出你的第83行代码】《阿里巴巴Java开发手册》主要作者孤尽晒出入职第一年的代码...
  19. 关于下载JDK需要注册账号
  20. LongHash 和Cryptic Labs 今天宣布达成战略合作

热门文章

  1. c语言题之二维数组的查找
  2. php如何设置邮箱,phpcms邮箱如何设置
  3. C++图像处理 -- 图像合成
  4. Postman系列(八)-全局变量(Global)、环境变量(Environment)、集合变量(Collection)
  5. 国产版stlinkv2更新固件
  6. matlab legend 太大,[转载]MATLAB中调整legend的大小位置
  7. 关于专利权的期限、终止和无效
  8. HTML5 六 MathML
  9. 一种基于区块链的场外交易平台
  10. idea maven 使用本地jar包