当前位置: 首页 > news >正文

手机排行榜网站教育平台网站开发

手机排行榜网站,教育平台网站开发,wordpress 淘宝优惠券,微网站与微信的关系前言#xff1a;使用NestedScrollView嵌套RecyclerView。 解决步骤一#xff1a;固定高度 NestedScrollView嵌套RecyclerView时#xff0c;RecyclerView的高度是无限大#xff0c;所以要将RecyclerView设置固定高度。在代码中固定的#xff0c;灵活度更高。 binding.nest…前言使用NestedScrollView嵌套RecyclerView。 解决步骤一固定高度 NestedScrollView嵌套RecyclerView时RecyclerView的高度是无限大所以要将RecyclerView设置固定高度。在代码中固定的灵活度更高。 binding.nestedScrollV.post(new Runnable() {Overridepublic void run() {binding.selectList.getLayoutParams().height binding.nestedScrollV.getHeight(); // 使用NestedScrollView的高度binding.productList.getLayoutParams().height binding.nestedScrollV.getHeight(); binding.selectList.setLayoutParams(binding.selectList.getLayoutParams()); binding.productList.setLayoutParams(binding.productList.getLayoutParams());}); 解决步骤二重写NestedScrollView的 measureChildWithMargins() 函数 public class MNestedScrollViewBox extends NestedScrollView {public MNestedScrollViewBox(NonNull Context context, Nullable AttributeSet attrs) {super(context, attrs);}// 使用NestedScrollView嵌套RecyclerView会导致RecyclerView复用机制失效RecyclerView会将所有数据一次性全部加载。// 解决方法重写measureChildWithMargins让NestedScrollView测量RecyclerView时 不使用MeasureSpec.UNSPECIFIED模式即可。Overrideprotected void measureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed) {child.measure(parentWidthMeasureSpec, parentHeightMeasureSpec);}} 使用 ?xml version1.0 encodingutf-8? com.xx.xx.ui.widget.MNestedScrollViewBox xmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:toolshttp://schemas.android.com/toolsandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:backgroundcolor/color_F5F6F7android:fillViewporttrueandroid:overScrollModenevertools:context.ui.fragment.shopdetail.OrderFoodFragmentLinearLayoutandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroidx.recyclerview.widget.RecyclerViewandroid:idid/select_listandroid:layout_width84dpandroid:layout_heightmatch_parentandroid:overScrollModenevertools:listitemlayout/widget_select_item_ho /androidx.recyclerview.widget.RecyclerViewandroid:idid/product_listandroid:layout_width0dpandroid:layout_heightmatch_parentandroid:layout_weight1android:backgroundcolor/whiteandroid:overScrollModeneverandroid:paddingStart8dptools:ignoreRtlSymmetrytools:listitemlayout/widget_product_item_ho //LinearLayout/com.xx.xx.ui.widget.MNestedScrollViewBox
http://www.pierceye.com/news/849317/

相关文章:

  • 班级网站自助建设功能没有充值入口的传奇
  • 杭州网站seo免费网站建设
  • 好看的网站设计网站开发龙岗网站建设
  • 物流如何做网站wordpress qq互联插件
  • 权威发布李建济南做seo排名
  • 六安网站建设 220广州安尔捷做的网站好吗
  • 企业网站写好如何发布wordpress免插件生成地图
  • 公司 网站 苏州链接下载
  • 网站页面设计素材网站做权重的方法
  • 网站优化标题怎么做宿迁房产网备案查询
  • 建设企业官方网站的流程秦皇岛网站备案
  • 北京网站优化前景建设银行包头分行网站
  • 南京江宁区住房建设局网站电商交流平台有哪些
  • 查询网站流量排名做网站 我们的工人怎么写
  • 龙岗-网站建设深圳信科免备案的网站空间
  • 360网站推广官网软件安徽海外网络推广
  • c# asp.net网站开发书考试网站怎么做的
  • 网站开发 技术路线融资融券配资网站建设
  • 建设网站如国家高新技术企业证书
  • 网站服务是什么网站建设投标书报价表
  • 商业网站开发与设计宝塔面板wordpress安装
  • 学交互设计网站企业网站建设要多久
  • 免费情感网站哪个好有没有帮忙做标书的网站
  • 申请域名需要多久大连seo顾问
  • 舟山外贸建站公司做文案选图片素材的网站
  • 网站开发从何学起公司网站在哪里做
  • 无锡网站制作哪家有名金华安全网站建设怎么收费
  • dw做响应式网站重庆黄埔建设集团网站
  • 做系统那个网站好wordpress添加返回顶部
  • 站网站推广汕头网站建设和运营