document.write("");
摘要: 背景:RecyclerView 左右滑动时,需要获取当前显示在页面上的选项卡 步骤: 1. RecyclerView 添加addOnScrollListener,回调中可以直接获取对应Item Index xxxRecyclerView.addOnScrollListener(new Recycle 阅读全文
posted @ 2024-06-07 09:23 人间春风意 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 背景:水平滚动的List,一项Item占满页面宽度,相当于数量不定的选项卡,每个选项卡占满一页,左右滑动时,如何限制一次只能滑动一个Item 步骤: 1. 水平滚动布局 linearLayoutManager = new LinearLayoutManager(this); linearLayout 阅读全文
posted @ 2024-06-07 09:16 人间春风意 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 问题背景:使用适配器显示一个列表,列表中Item中有EditText,滚动时会有EditText组件内容消失 步骤: 1. 在Adapter中,添加interface public interface OnEidtTextChangeListener { void xxxTextChanged(Ch 阅读全文
posted @ 2024-06-07 09:09 人间春风意 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 在Activity中,使用this.getCurrentFocus(),获取当前焦点所在的View, 再判断是否是EditText(可调整成其他组件),看个人需要再做特定的逻辑处理 String content = "xxxxx"; EditText focusedEditText = null; 阅读全文
posted @ 2024-06-07 08:52 人间春风意 阅读(5) 评论(0) 推荐(0) 编辑