<bdo id='tsJbB'></bdo><ul id='tsJbB'></ul>

    <small id='tsJbB'></small><noframes id='tsJbB'>

  • <i id='tsJbB'><tr id='tsJbB'><dt id='tsJbB'><q id='tsJbB'><span id='tsJbB'><b id='tsJbB'><form id='tsJbB'><ins id='tsJbB'></ins><ul id='tsJbB'></ul><sub id='tsJbB'></sub></form><legend id='tsJbB'></legend><bdo id='tsJbB'><pre id='tsJbB'><center id='tsJbB'></center></pre></bdo></b><th id='tsJbB'></th></span></q></dt></tr></i><div id='tsJbB'><tfoot id='tsJbB'></tfoot><dl id='tsJbB'><fieldset id='tsJbB'></fieldset></dl></div>
  • <tfoot id='tsJbB'></tfoot>

        <legend id='tsJbB'><style id='tsJbB'><dir id='tsJbB'><q id='tsJbB'></q></dir></style></legend>
      1. android回收器视图中的水平和垂直滚动

        时间:2023-10-04
              <tfoot id='8Xnfb'></tfoot>
                • <bdo id='8Xnfb'></bdo><ul id='8Xnfb'></ul>
                    <tbody id='8Xnfb'></tbody>
                • <small id='8Xnfb'></small><noframes id='8Xnfb'>

                  <i id='8Xnfb'><tr id='8Xnfb'><dt id='8Xnfb'><q id='8Xnfb'><span id='8Xnfb'><b id='8Xnfb'><form id='8Xnfb'><ins id='8Xnfb'></ins><ul id='8Xnfb'></ul><sub id='8Xnfb'></sub></form><legend id='8Xnfb'></legend><bdo id='8Xnfb'><pre id='8Xnfb'><center id='8Xnfb'></center></pre></bdo></b><th id='8Xnfb'></th></span></q></dt></tr></i><div id='8Xnfb'><tfoot id='8Xnfb'></tfoot><dl id='8Xnfb'><fieldset id='8Xnfb'></fieldset></dl></div>
                • <legend id='8Xnfb'><style id='8Xnfb'><dir id='8Xnfb'><q id='8Xnfb'></q></dir></style></legend>

                  本文介绍了android回收器视图中的水平和垂直滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I have a requirement where I need to have horizontal scrolling and vertical scrolling in a recycler view. It is based on the type of data that is coming from server. If the response from server is having first element as an array, i need that to be in a horizontal scrolling list and if the second element is a single object, then i need to show it in card. Similarly the order changes and should reflect in the UI. How can I achieve this.

                  解决方案

                  LayoutManager is the class that layout views in RecyclerView. So change recyclerView.setLayoutManager(LayoutManager) if you want to change layout. In your case, if you use LinearLayoutManager, do this by calling:

                  LinearLayoutManager layoutManager = ...
                  recyclerView.setLayoutManager(layoutManager);
                  
                  //when you want horizontal
                  layoutManager.setOrientation(context, LinearLayoutManager.HORIZONTAL);
                  
                  //when you want vertical
                  layoutManager.setOrientation(context, LinearLayoutManager.VERTICAL);
                  

                  这篇关于android回收器视图中的水平和垂直滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:带有 ViewPager 的 TabLayout 在片段 Android 中不起作用 下一篇:来自 viewpager2 和我的父片段的 SharedViewModel

                  相关文章

                    <i id='ONFff'><tr id='ONFff'><dt id='ONFff'><q id='ONFff'><span id='ONFff'><b id='ONFff'><form id='ONFff'><ins id='ONFff'></ins><ul id='ONFff'></ul><sub id='ONFff'></sub></form><legend id='ONFff'></legend><bdo id='ONFff'><pre id='ONFff'><center id='ONFff'></center></pre></bdo></b><th id='ONFff'></th></span></q></dt></tr></i><div id='ONFff'><tfoot id='ONFff'></tfoot><dl id='ONFff'><fieldset id='ONFff'></fieldset></dl></div>
                      <bdo id='ONFff'></bdo><ul id='ONFff'></ul>
                    <legend id='ONFff'><style id='ONFff'><dir id='ONFff'><q id='ONFff'></q></dir></style></legend>

                  1. <tfoot id='ONFff'></tfoot>
                  2. <small id='ONFff'></small><noframes id='ONFff'>