RelativeLayout weight

前端 未结 4 570
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-02 23:25

In a layout resource XML, I have 3 RelativeLayout(s) which are inside a main RelativeLayout. The view will be shown vertically. These 3 RelativeLayout() are set next to each

4条回答
  •  鱼传尺愫
    2020-12-03 00:00

    You can use Horizontally oriented LinearLayout Manager in the Recycler View, and place each RelativeLayout in each item, of its Adapter.

    The Link: How to build a Horizontal ListView with RecyclerView?

    If your RelativeLayouts are set to a fixed width and height, that is to the size of the Screen, that you can get from DisplayMatrics, that will be OK.

    The Link: Get Screen width and height

    If the contents of your RelativeLayouts are different, then you can use getItemViewType() method.

    Please see: How to create RecyclerView with multiple view type?

    Happy Coding :-)

提交回复
热议问题